-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
[react-native] Avoid using ExecutionEnvironment.canUseDOM
#2954
Comments
What is the issue here? |
Hi @josephsavona, As specified in the comment below, this condition must be true when “executed in a server environment”.
While it is true even when it is executed in a react-native environment because ExecutionEnvironment.canUseDOM is false both on the server side and in react-native. So even in react-native does not do the temporaryRetain. |
I think this makes sense, will test internally and land |
This issue can be closed as it is resolved in this PR #2960. |
The canUseDOM variable defined with the following condition:
!!(typeof window !== 'undefined' && window.document && window.document.createElement);
This condition returns false in react-native context.
The change only affects relay-experimental & tests:
https://github.com/facebook/relay/blob/master/packages/relay-experimental/QueryResource.js#L155
https://github.com/facebook/relay/blob/master/packages/relay-experimental/preloadQuery_DEPRECATED.js#L162
https://github.com/facebook/relay/blob/master/packages/relay-experimental/preloadQuery_DEPRECATED.js#L194
The text was updated successfully, but these errors were encountered: