Replies: 3 comments 1 reply
-
snippet from the react-location docs
so it seems like the best approach would be a custom resolver that adds the properties i want like above. |
Beta Was this translation helpful? Give feedback.
-
Wrote an example custom resolver for React-Location https://github.com/bzbetty/vite-plugin-pages/tree/main/examples/react-location used a unicode replacement hack instead of the regex approach the stringify. certainly felt like i was missing access to a lot of things to write this well. |
Beta Was this translation helpful? Give feedback.
-
Came across another framework which does something similar using Vite import.meta.glob, thought it was cute. https://github.com/oedotme/render/blob/main/src/config/routes.tsx |
Beta Was this translation helpful? Give feedback.
-
So i know i can use the extendRoute method to add in extra props to a route, but I was hoping to find a way of doing these extensions in the component file itself.
Essentially trying to get the same behaviour as the SFC tag
Initially I figured it'd make sense to replace a components default export with an object
eg
export default index;
becomes
but maybe there's a way to do this already?
Note: I'm actually doing a PoC to make this work with React-Location (not just react router) which is why i want this support as React-Location supports extra props
Do i just want a custom Resolver?
Beta Was this translation helpful? Give feedback.
All reactions