mobx
mobx copied to clipboard
using `enableStaticRender()` on the server causes "read outside a reactive context" warnings on server
Intended outcome:
Trying to prevent memory leaks on SSR using the enableStaticRendering()
function while also avoiding warnings about data being read outside a reactive context
Actual outcome:
Calling enableStaticRendering()
causes the mobx warnings to be produced on my server.
How to reproduce the issue:
I can't provided a code sandbox since it doesn't support server-side rendering
Versions
latest versions of mobx
and mobx-react
Btw there probably isn't much of a reason to keep computedRequiresReaction
/observableRequiresReaction
set to true
on the server, so you can just turn these off before calling React.renderTo...
(unless you set them on inside a component or something like that)