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

Network.create() callback never called with last version of relay #24

Open
Luk-z opened this issue Feb 18, 2021 · 0 comments
Open

Network.create() callback never called with last version of relay #24

Luk-z opened this issue Feb 18, 2021 · 0 comments

Comments

@Luk-z
Copy link

Luk-z commented Feb 18, 2021

Does this package work with last version of relay?

The code in documentation won't work for me with the current version of relay

"react": "^17.0.1",
"react-relay": "^10.1.3",
"react-relay-network-modern": "^6.0.0",
"react-relay-network-modern-ssr": "^1.4.0",

The callback () => relayData[0][1] passed to Network.create is never called.

// Third, render the app a second time now that the Relay store has been primed
  // and send HTML and bootstrap data to the client for rehydration.
  const appHtml = ReactDOMServer.renderToString(
    <App
      relayEnvironment={new Environment({
        network: Network.create(() => relayData[0][1]), //NEVER CALLED!
        store,
      })}
    />
  );

here my code (ssr-break) branch .

I solved using fetchQuery from relay-runtime then renderToString once.

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

No branches or pull requests

1 participant