mobx icon indicating copy to clipboard operation
mobx copied to clipboard

using `enableStaticRender()` on the server causes "read outside a reactive context" warnings on server

Open heath-freenome opened this issue 1 year ago • 1 comments

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

heath-freenome avatar Mar 07 '23 00:03 heath-freenome

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)

urugator avatar Mar 07 '23 12:03 urugator