Having hard time understanding how to use nanojsx Router #46
-
Hey, I'm having hard time understanding how to make the router works on Client Side :( What I wanted to achieveI would like to have seemless navigation like a client side SPA would. But on the other end having each of my route properly SSR rendered as you can direct. In the template you provide we refresh and GET full new html file only for each page changes. The Question I haveIs it possible with NanoJSX to have each route as potentials entry points, but then deliver the javascript needed to handle routes changes on client side ?
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
It is possible. But keep in mind the whole point of Nano JSX is to reduce JavaScript. If your app hydrates the whole app, there is not much reduction in size. I personally never use the router and also had trouble setting it up the way I want. But, I just made a simple example for you using a simple custom routing method: Hope it helps :) |
Beta Was this translation helpful? Give feedback.
It is possible. But keep in mind the whole point of Nano JSX is to reduce JavaScript. If your app hydrates the whole app, there is not much reduction in size.
I personally never use the router and also had trouble setting it up the way I want.
(I guess I will have to change the router logic in the future. I don't like the react-like router.)
But, I just made a simple example for you using a simple custom routing method:
https://github.com/nanojsx/example1
Hope it helps :)