javascript - Pass useState function as props - Stack Overflow

PHOTO EMBED

Fri Aug 12 2022 00:08:07 GMT+0000 (UTC)

Saved by @SamMrch #react

const [showDialog, setShowDialog] = useState(true);

<DisclaimerModal
     text='...'
     showDialog={showDialog}
     handleAccept={() => setShowDialog(false)}
     handleDecline={() => setShowDialog(false)}
/>

content_copyCOPY

https://stackoverflow.com/questions/73327361/pass-usestate-function-as-props