Files
outline/app/menus/AccountMenu.tsx
T
Tom MoorandClaude Fable 5 b17f2611bf chore: React 18 upgrade (#13559)
* React 18 upgrade

* fix: Force synchronous React rendering in server HTML export

React 18 can defer a legacy ReactDOM.render commit when sync work is
queued, leaving exported component nodes empty. Wrap the render in
flushSync, and flush unmount-scheduled passive effects before global
env cleanup so React never runs without a window.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* refactor: Move server ComponentView to createRoot

ReactDOM.render and unmountComponentAtNode are removed in React 19.
flushSync around root.render keeps the mount synchronous for the
HTML-export path, which reads the DOM immediately after.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* Enable CI

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-09-03 01:43:47 -04:00

55 lines
1.3 KiB
TypeScript

import { observer } from "mobx-react";
import * as React from "react";
import { useTranslation } from "react-i18next";
import {
navigateToProfileSettings,
navigateToAccountPreferences,
openKeyboardShortcuts,
openChangelog,
openDocumentation,
openAPIDocumentation,
openBugReportUrl,
openFeedbackUrl,
logout,
} from "~/actions/definitions/navigation";
import { changeTheme } from "~/actions/definitions/settings";
import { ActionSeparator } from "~/actions";
import { useMenuAction } from "~/hooks/useMenuAction";
import { DropdownMenu } from "~/components/Menu/DropdownMenu";
type Props = {
children?: React.ReactNode;
};
const AccountMenu: React.FC<Props> = ({ children }: Props) => {
const { t } = useTranslation();
const actions = React.useMemo(
() => [
openKeyboardShortcuts,
openDocumentation,
openAPIDocumentation,
ActionSeparator,
openChangelog,
openFeedbackUrl,
openBugReportUrl,
changeTheme,
navigateToProfileSettings,
navigateToAccountPreferences,
ActionSeparator,
logout,
],
[]
);
const rootAction = useMenuAction(actions);
return (
<DropdownMenu action={rootAction} align="end" ariaLabel={t("Account")}>
{children}
</DropdownMenu>
);
};
export default observer(AccountMenu);