diff --git a/src/components/Layout/Sidebar/SidebarLink.tsx b/src/components/Layout/Sidebar/SidebarLink.tsx index 8a71d9e6e37..a2742e71b3c 100644 --- a/src/components/Layout/Sidebar/SidebarLink.tsx +++ b/src/components/Layout/Sidebar/SidebarLink.tsx @@ -17,6 +17,7 @@ interface SidebarLinkProps { title: string; level: number; canary?: boolean; + deprecated?: boolean; icon?: React.ReactNode; isExpanded?: boolean; hideArrow?: boolean; @@ -28,6 +29,7 @@ export function SidebarLink({ selected = false, title, canary, + deprecated, level, isExpanded, hideArrow, @@ -63,7 +65,9 @@ export function SidebarLink({ 'text-sm ps-6': level > 0, 'ps-5': level < 2, 'text-base font-bold': level === 0, - 'text-primary dark:text-primary-dark': level === 0 && !selected, + 'text-primary dark:text-primary-dark': + !deprecated && level === 0 && !selected, + 'text-gray-30 dark:text-gray-60': deprecated && !selected, 'text-base text-secondary dark:text-secondary-dark': level > 0 && !selected, 'text-base text-link dark:text-link-dark bg-highlight dark:bg-highlight-dark border-blue-40 hover:bg-highlight hover:text-link dark:hover:bg-highlight-dark dark:hover:text-link-dark': diff --git a/src/components/Layout/Sidebar/SidebarRouteTree.tsx b/src/components/Layout/Sidebar/SidebarRouteTree.tsx index a9fa575b510..ad6a81cfe6d 100644 --- a/src/components/Layout/Sidebar/SidebarRouteTree.tsx +++ b/src/components/Layout/Sidebar/SidebarRouteTree.tsx @@ -87,6 +87,7 @@ export function SidebarRouteTree({ title, routes, canary, + deprecated, heading, hasSectionHeader, sectionHeader, @@ -121,6 +122,7 @@ export function SidebarRouteTree({ level={level} title={title} canary={canary} + deprecated={deprecated} isExpanded={isExpanded} hideArrow={isForceExpanded} /> @@ -145,6 +147,7 @@ export function SidebarRouteTree({ level={level} title={title} canary={canary} + deprecated={deprecated} /> ); diff --git a/src/components/Layout/getRouteMeta.tsx b/src/components/Layout/getRouteMeta.tsx index 3564dd73850..2db450967ce 100644 --- a/src/components/Layout/getRouteMeta.tsx +++ b/src/components/Layout/getRouteMeta.tsx @@ -21,6 +21,8 @@ export interface RouteItem { title: string; /** Optional canary flag for heading */ canary?: boolean; + /** Optional deprecated flag */ + deprecated?: boolean; /** Optional page description for heading */ description?: string; /* Additional meta info for page tagging */ diff --git a/src/content/reference/react-dom/deprecated.md b/src/content/reference/react-dom/deprecated.md new file mode 100644 index 00000000000..e2bfed1c00d --- /dev/null +++ b/src/content/reference/react-dom/deprecated.md @@ -0,0 +1,9 @@ +--- +title: Deprecated React DOM APIs +--- + + + +The APIs documented under this page have been deprecated or removed from React. They are documented here for historical purposes or for users who are still using older versions of React. + + diff --git a/src/content/reference/react-dom/render.md b/src/content/reference/react-dom/render.md index 03feb2881c3..fabeb6b582a 100644 --- a/src/content/reference/react-dom/render.md +++ b/src/content/reference/react-dom/render.md @@ -4,7 +4,7 @@ title: render -This API will be removed in a future major version of React. +In React 19, `unmountComponentAtNode` was removed. In React 18, `render` was replaced by [`createRoot`.](/reference/react-dom/client/createRoot) Using `render` in React 18 will warn that your app will behave as if it’s running React 17. Learn more [here.](/blog/2022/03/08/react-18-upgrade-guide#updates-to-client-rendering-apis) diff --git a/src/content/reference/react-dom/unmountComponentAtNode.md b/src/content/reference/react-dom/unmountComponentAtNode.md index 376a9bc2bfb..899dcd6ba8d 100644 --- a/src/content/reference/react-dom/unmountComponentAtNode.md +++ b/src/content/reference/react-dom/unmountComponentAtNode.md @@ -4,7 +4,7 @@ title: unmountComponentAtNode -This API will be removed in a future major version of React. +In React 19, `unmountComponentAtNode` was removed. In React 18, `unmountComponentAtNode` was replaced by [`root.unmount()`](/reference/react-dom/client/createRoot#root-unmount). diff --git a/src/sidebarReference.json b/src/sidebarReference.json index 2b13649fa0d..c08bc7bc91d 100644 --- a/src/sidebarReference.json +++ b/src/sidebarReference.json @@ -295,14 +295,6 @@ "title": "preloadModule", "path": "/reference/react-dom/preloadModule", "canary": true - }, - { - "title": "render", - "path": "/reference/react-dom/render" - }, - { - "title": "unmountComponentAtNode", - "path": "/reference/react-dom/unmountComponentAtNode" } ] }, @@ -350,6 +342,21 @@ } ] }, + { + "title": "Deprecated APIs", + "path": "/reference/react-dom/deprecated", + "deprecated": true, + "routes": [ + { + "title": "render", + "path": "/reference/react-dom/render" + }, + { + "title": "unmountComponentAtNode", + "path": "/reference/react-dom/unmountComponentAtNode" + } + ] + }, { "hasSectionHeader": true, "sectionHeader": "Rules of React"