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
Concern about unstable_read and SSR #2544
Comments
cc @jstejada |
jstejada
referenced
this issue
Oct 17, 2018
Reviewed By: jstejada Differential Revision: D9972097 fbshipit-source-id: a04c576fa93085e172373ee3ca8ed35be8299fc3
Thanks for bringing this up @johntran, @TrySound. React is actually going to remove unstable_read, so we will end updating this in a way that is also SSR compatible |
Well, it's not quite removed. It's hidden in react internals. Libraries still can use it for own purpose. For example in relay it would be nice to have an api without render props and HOCs like this const fragment = createFragment(
graphql``
)
const Component = props => {
const user = fragment.read(props.user)
return null
} |
TrySound
referenced
this issue
Jan 26, 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi there,
@TrySound brought up a good point in this comment about how SSR wouldn't work for components where
unstable_read
is being used.It seems to be best to revert the change back to use
<ReactRelayContext.Consumer>
and useunstable_read
in therelay-experimental
package.@TrySound provided a codesandbox repo to show how
unstable_read
breaks SSR: https://codesandbox.io/s/l5j35928xlThoughts?
The text was updated successfully, but these errors were encountered: