-
Notifications
You must be signed in to change notification settings - Fork 55
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
Include ReactNode in render method result #1062
base: master
Are you sure you want to change the base?
Conversation
new Redirect({ | ||
from: 'baz', | ||
to: '/foo', | ||
}), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is what didn't compile despite it being valid.
src/createElements.tsx
Outdated
@@ -20,7 +20,7 @@ export default function createElements( | |||
routeMatches: Array<RouteMatch>, | |||
Components: React.ComponentType<any>[], | |||
matchData: any, | |||
): Array<ResolvedElement | undefined> { | |||
): Array<React.ReactNode | ResolvedElement | undefined> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is the correct fix, This method _doesn't) actually return a ReactNode, it only turns route component elements. The problem is Redirect.render shouldn't return a ReactNode
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh ok. I didn't do that since it was a potentially breaking change. I've changed it.
Fixes #1061