Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RFC: Move deprecated APIs in sidebar #6759

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/components/Layout/Sidebar/SidebarLink.tsx
Expand Up @@ -17,6 +17,7 @@ interface SidebarLinkProps {
title: string;
level: number;
canary?: boolean;
deprecated?: boolean;
icon?: React.ReactNode;
isExpanded?: boolean;
hideArrow?: boolean;
Expand All @@ -28,6 +29,7 @@ export function SidebarLink({
selected = false,
title,
canary,
deprecated,
level,
isExpanded,
hideArrow,
Expand Down Expand Up @@ -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':
Expand Down
3 changes: 3 additions & 0 deletions src/components/Layout/Sidebar/SidebarRouteTree.tsx
Expand Up @@ -87,6 +87,7 @@ export function SidebarRouteTree({
title,
routes,
canary,
deprecated,
heading,
hasSectionHeader,
sectionHeader,
Expand Down Expand Up @@ -121,6 +122,7 @@ export function SidebarRouteTree({
level={level}
title={title}
canary={canary}
deprecated={deprecated}
isExpanded={isExpanded}
hideArrow={isForceExpanded}
/>
Expand All @@ -145,6 +147,7 @@ export function SidebarRouteTree({
level={level}
title={title}
canary={canary}
deprecated={deprecated}
/>
</li>
);
Expand Down
2 changes: 2 additions & 0 deletions src/components/Layout/getRouteMeta.tsx
Expand Up @@ -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 */
Expand Down
9 changes: 9 additions & 0 deletions src/content/reference/react-dom/deprecated.md
@@ -0,0 +1,9 @@
---
title: Deprecated React DOM APIs
---

<Intro>

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.

</Intro>
2 changes: 1 addition & 1 deletion src/content/reference/react-dom/render.md
Expand Up @@ -4,7 +4,7 @@ title: render

<Deprecated>

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)

Expand Down
2 changes: 1 addition & 1 deletion src/content/reference/react-dom/unmountComponentAtNode.md
Expand Up @@ -4,7 +4,7 @@ title: unmountComponentAtNode

<Deprecated>

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).

Expand Down
23 changes: 15 additions & 8 deletions src/sidebarReference.json
Expand Up @@ -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"
}
]
},
Expand Down Expand Up @@ -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"
Expand Down