Using signal in child component
Hi,
I'm new to all this and am trying to figure out how to control a signal from a child component.
In my case I'm using solid-bootstrap to present a modal. The modal showing and hiding is triggered by a signal 'show' which is set by a button to show it and a cancel button to hide it.
It all works great in one big component but I'd like to break the modal out to another component and have it be able to close itself. Since it opens with a button in the parent I think I need the signal there, but when I try to pass it to the child as a function <MyModal setShow={setShow} /> it does not work.
What is a good way to structure something like this?
Thanks in advance.
I'm new to all this and am trying to figure out how to control a signal from a child component.
In my case I'm using solid-bootstrap to present a modal. The modal showing and hiding is triggered by a signal 'show' which is set by a button to show it and a cancel button to hide it.
It all works great in one big component but I'd like to break the modal out to another component and have it be able to close itself. Since it opens with a button in the parent I think I need the signal there, but when I try to pass it to the child as a function <MyModal setShow={setShow} /> it does not work.
What is a good way to structure something like this?
Thanks in advance.
