Usually there would be a problem importing/defining things from static files like that as this would be shared within the server between instances of renderings.
Usually there would be a problem importing/defining things from static files like that as this would be shared within the server between instances of renderings.
So to answer the question, yes SimpleR State works with SSR, but you need to take an extra step. You would need to somehow "scope" your global state inside the React component tree. The most common solution is using a Context to store your server-side entities, so that they are not "shared" among SSR requests.
SimpleR State proclaims itself as "unopinionated", so the preferred SSR solution is a decision that the developer has to make. It would be worth adding some options in the documentation, though. So thanks for bringing this up. I also received a few requests on such documentation in the previous Request For Comments during the beta run. A doc page on SSR is underway.
This is my take on the problem -> https://github.com/Munawwar/react-global-states/tree/ssr