[Start]: How to separate client and server routers? #5468
josippapez
started this conversation in
General
Replies: 1 comment 1 reply
-
how about export const getRouter = createIsomorphicFn().server(() => {
// create server side router
})
.client(() => {
// create client side router
}) |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I've just updated to the latest version from
1.132.23
to1.132.47
and since then, thessr.tsx
setup changed. Before, i could defined thecreateRouter
in thessr.tsx
like this:but now the signature has changed and the
ssr.tsx
needs to only export the handlers like fetch.Personally, I think that the previous way of defining routers was way more intuitive since it doesn't abstract the creation of router to one place and adding if cases everywhere to satisfy the server side checks.
I've managed to partially make it work like this:
But still, it's not the same behaviour as before
Beta Was this translation helpful? Give feedback.
All reactions