DEV Community

Discussion on: Usestate hook not working inside arrow component.

Collapse
stereobooster profile image
stereobooster

Post link to full example. Code of the component is ok codesandbox.io/s/goofy-feynman-vl3ny

Do you try to call component as function instead of using as component?

Collapse
itssimondev profile image
Simone Aronica Author • Edited on

I've edited the post.

Collapse
stereobooster profile image
stereobooster

Post link to codesandbox (not preview but sandbox itslef) where we can see error.

Thread Thread
itssimondev profile image
Simone Aronica Author

I solved it. Apparently all I had to do was setting react as an external.

Thread Thread
fattah profile image
Fattah Bezaz

hi simon could you tell me how you solved it? I have the same problem :(