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

Warning when using a React component in an Astro project #49

Closed
JacobZwang opened this issue Jul 1, 2024 · 3 comments
Closed

Warning when using a React component in an Astro project #49

JacobZwang opened this issue Jul 1, 2024 · 3 comments

Comments

@JacobZwang
Copy link

When using nanoquery in a react component in an astro project I get this warning in the console. I'm not familiar enough with react to completely understand this warning so I'm not sure if this is a problem or not.

Warning: The result of getServerSnapshot should be cached to avoid an infinite loop
at NanoQueryExample (http://localhost:4322/src/components/nanoquery.tsx:31:29)

https://stackblitz.com/github/JacobZwang/nanoquery-astro-broken-example
https://github.com/JacobZwang/nanoquery-astro-broken-example

@sitarass
Copy link

sitarass commented Aug 7, 2024

m2 in nextjs project

@sitarass
Copy link

sitarass commented Aug 8, 2024

@dkzlv check here the error
image

@dkzlv
Copy link
Member

dkzlv commented Aug 8, 2024

This is not a bug, just excessive logging by React.

Refer to this comment, header getSnapshot should be cached .

@dkzlv dkzlv closed this as completed Aug 8, 2024
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

3 participants