-
-
Notifications
You must be signed in to change notification settings - Fork 109
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
Using parameters with preact-iso/router
#298
Comments
Hiya! I ran into this myself and threw a workaround together, but it's really gross. Instead, I think we should just land support for |
Thanks for the heads up. I'll give it a shot. |
thanks for this issue and for the PR! I noticed that the following code functions correctly on const publicRoutes = {
"/blog": lazy(() => import('./pages/blog.js')),
"/blog/:id": lazy(() => import('./pages/blog/single-post.js'))
};
const privateRoutes = {
"/settings": lazy(() => import('./pages/settings.js'))
};
export function App(serverData) {
return (
<main id="main">
<Router>
{Object.entries(publicRoutes).map(
([ path, Component ]) => <Component path={path} key={path} />
)}
{Object.entries(privateRoutes).map(
([ path, Component ]) => <PrivateRoute component={Component} path={path} key={path} />
)}
<NotFound default />
</Router>
</main>
);
} I believe this is due to thanks again! |
When using
preact-iso/router
, which is the default inwmr
, it doesn't seem to be possible to use route parameters.Am I missing something? What's the recommended approach here?
The sample will always result in "not found". Removing the optional parameter from the home route, will make "home" work again.
The text was updated successfully, but these errors were encountered: