#Form in Modal and useState

1 messages · Page 1 of 1 (latest)

echo crypt
#

Hi.

I'm trying to create edit Modal which when called will edit value passed to it. I'm using a form inside of modal.

It works fine but I cant call useState or eseEffect inside as I get "Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:" error.

Could I get some guidance? Thank you 🙏

https://codesandbox.io/s/form-in-modal-uobfek?file=/src/App.js

gritty oriole
#

its because of this I believe

#

But also, this won't work because modals from openModal can't change state

#

use the Modal component instead

wanton plume
#

#❓-faq message