Closed amir1376 closed 4 months ago
Of course there is, it's briefly mentioned in the documentation, just use the loader from react-router.
There's also an example here: https://github.com/Daydreamer-riri/vite-react-ssg/blob/main/examples%2Fwith-loader%2Fsrc%2Fpages%2F%5Bdocs%5D.tsx
Ah. I didn't see it at first place. Thanks
Thank you for your use. If you have other questions, please let me know and I will reply as soon as possible.
In addition, the current loader will still be executed when the client route jumps. I will implement the Loader API that runs only when the build is in the next minor release.
Hi @amir1376 , as of 0.7.0, the loader will only run on the server.
See: https://github.com/Daydreamer-riri/vite-react-ssg/tree/v0.7.0?tab=readme-ov-file#data-fetch
Hello, first of all thanks for your work
I want to know is there anything like nextjs's getServerSideProps in this library?
I want to fetch a json from remote (and also transform it) in build time and pass it into client for SSG so clients don't have to fetch that data everytime