Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
heath-freenome opened this issue Mar 7, 2023 · 1 comment · May be fixed by #3649
Assignees
Labels

Comments

@heath-freenome
Copy link

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

@urugator
Copy link
Collaborator

urugator commented Mar 7, 2023

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
3 participants