How to make button with create portal and fetching data?
Unanswered
Somali posted this in #help-forum
SomaliOP
Tell me, I just can’t think of a solution.
I have a button component inside which I want to create a portal with a modal. That is, this is a client component, but I also need to get data about the modal inside this button or somewhere outside (passing this data with props inside each button is not an option, since there are many buttons, but the same data).
I even created a wrapper for the button to receive data in it, and then implement the useState logic inside it. But since the button component can be inside a client component, it also becomes a client component, and this breaks everything.
example screenshot
I have a button component inside which I want to create a portal with a modal. That is, this is a client component, but I also need to get data about the modal inside this button or somewhere outside (passing this data with props inside each button is not an option, since there are many buttons, but the same data).
I even created a wrapper for the button to receive data in it, and then implement the useState logic inside it. But since the button component can be inside a client component, it also becomes a client component, and this breaks everything.
example screenshot