react-native-modalize icon indicating copy to clipboard operation
react-native-modalize copied to clipboard

How to leave it open by default

Open Lacerda53 opened this issue 2 years ago • 2 comments

I need the modal behavior to be open by default and not closed, how could I solve the problem?

With useEffect?

Lacerda53 avatar Jun 26 '22 15:06 Lacerda53

@jeremybarbet #432 solution

Lacerda53 avatar Jun 26 '22 16:06 Lacerda53

How did you manage it?

the useEffect answer is also good for me if the merge takes to much time

Dani-Boy92 avatar Jul 01 '22 05:07 Dani-Boy92

Apply UseEffect and setTimeout for the modal to display on entering screen.

useEffect(() => {
    setTimeout(() => visible ? ref.current.open() : ref.current.close(), 100);
  }, [visible])

infinitesekai avatar Mar 18 '24 09:03 infinitesekai