You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think it would be very useful to add in the documentation how to use it in the nextjs server components, at first it took me a bit to understand it and it can help more than one developer.
The text was updated successfully, but these errors were encountered:
jocarrd
changed the title
Add how to use the library with NextJS 13 app directory
Add how to use react-countup with NextJS 13 app directory
May 1, 2023
I'm unable to get it working at all with Next app directory. It just displays as <span></span>
Update: It's being caused by a completely seperate issue. For some reason, another component using: dangerouslySetInnerHTML is preventing this from running.
I think it would be very useful to add in the documentation how to use it in the nextjs server components, at first it took me a bit to understand it and it can help more than one developer.
NextJS doc
Example:
if you try to use it directly within a Server Component, you'll see an error:
This is because Next.js doesn't know is using client-only features.
To fix this, you can wrap third-party components that rely on client-only features in your own Client Components:
Now, you can use directly within a Server Component:
The text was updated successfully, but these errors were encountered: