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
react-router-dom Route error #8210
Comments
It is not an error, in fact, there is no rendering in Route, it is only used to pass props. export function Route(
_props: PathRouteProps | LayoutRouteProps | IndexRouteProps
): React.ReactElement | null {
// do nothing...
} and in Routes: export function Routes({
children,
location
}: RoutesProps): React.ReactElement | null {
return useRoutes(createRoutesFromChildren(children), location);
}
export function createRoutesFromChildren(
children: React.ReactNode
): RouteObject[] {
let routes: RouteObject[] = [];
React.Children.forEach(children, element => {
// ......
let route: RouteObject = {
caseSensitive: element.props.caseSensitive,
element: element.props.element,
index: element.props.index,
path: element.props.path
};
if (element.props.children) {
route.children = createRoutesFromChildren(element.props.children);
}
routes.push(route);
});
return routes;
} |
thank you |
Just FYI we added an |
okay thank you
…On Sat, Nov 6, 2021 at 1:08 AM Michael Jackson ***@***.***> wrote:
Just FYI we added an invariant that will yell at you about this in #8238
<#8238>
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
<#8210 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ASVJ2ILJ5XB6TNHVXO7YIH3UKRBWDANCNFSM5HLK2HMQ>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If we replace <Route path="/" children={}> with
<span path="/" children={}>
it works as Route why?
The text was updated successfully, but these errors were encountered: