I am working on a react Movie app and I want to pass a showModal useState to another component as I have a conditional on the component with my showModal like this:
const [showModal, setShowModal] = useState(false);
return (
<>
{showModal ? (<div>Modal..</div>) : null}
</>
Then on the other component I want to pass the hook to is something like this:
... <button
type="button"
onClick={() => setShowModal(true)}
className="my-4 border text-white py-2 px-4 rounded-3xl border-blue-600 bg-blue-600 shadow-lg"
>
Watch trailer
</button>...
Thanks in advance!