You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 13, 2023. It is now read-only.
fetchData should not be called on components that do not belong to react-apollo during server render.
Actual outcome:
If the component is not expecting fetchData to be called, SSR will fail. Right now, when walking the tree, react-apollo only checks if an instance exists and that it has a function called fetchData:
The implementation of getDataFromTree has changed substantially in [email protected] (the latest version), thanks to #2533. In particular, we no longer attempt to detect whether component instances have a fetchData method. Please try updating, and feel free to reopen this issue if the problem persists.
Intended outcome:
fetchData
should not be called on components that do not belong toreact-apollo
during server render.Actual outcome:
If the component is not expecting
fetchData
to be called, SSR will fail. Right now, when walking the tree,react-apollo
only checks if an instance exists and that it has a function calledfetchData
:react-apollo/src/getDataFromTree.ts
Lines 139 to 154 in 9222ab3
That is problematic if the instance has a function called
fetchData
that should not be called during server rendering.How to reproduce the issue:
Add something along the lines of the following to a component being server rendered:
Version
The text was updated successfully, but these errors were encountered: