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

Assert that the fragment passed to useResult (et al?) never changes #349

Open
rbalicki2 opened this issue Jan 29, 2025 · 1 comment
Open

Comments

@rbalicki2
Copy link
Collaborator

We should do something like https://github.com/facebook/relay/blob/f19f330f4e7614f36e612f75ee891fae46c8b09b/packages/react-relay/relay-hooks/useStaticFragmentNodeWarning.js#L4

  • We don't have a concept of a dev variable, so for now, we can just do it
  • Make this hook generic, i.e. call it useAssertUnchangingValue or something, and throw an error if it changes
  • Add it to useResult
@PatrykWalach
Copy link
Collaborator

useResult should work fine if the fragment returns a component right now,
in case it's a resolver, then it will not rerender right now, but it will be fixed in #343,

then we should only assert that the type of the fragment doesn't change?

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

2 participants