Skip to content

rerender function returned from renderHookToSnapshotStream requires a props argument even when its optional #13

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

Closed
jerelmiller opened this issue Jan 10, 2025 · 1 comment · Fixed by #14
Labels
bug Something isn't working

Comments

@jerelmiller
Copy link
Collaborator

Take the following test:

const { takeSnapshot, getCurrentSnapshot, rerender } =
  await renderHookToSnapshotStream(
    () => {
      return useLazyQuery(query, {
        fetchPolicy: "cache-first",
        variables: { id: "1" },
      });
    },
    {
      wrapper: ({ children }) => (
        <ApolloProvider client={client}>{children}</ApolloProvider>
      ),
    }
  );

When I try to use rerender, I get an error that an argument is required:

await rerender();
// ^ Expected 1 arguments, but got 0.

Ideally the argument is only required if the hook callback requires props.

Copy link
Contributor

🎉 This issue has been resolved in version 2.0.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
1 participant