Yeah that's where I landed too. If the hook is coupled to the UI any way, why not? One thing I've been noodling on lately is flipping it. Where component has the hook tacked on it.
import Modal from "./Modal"
// then use the hook like
let modal = Modal.useModal({ ...stuff } )
// and use the component like
<Modal {...modal.modalProps }>
....
</Modal>
Yeah that's where I landed too. If the hook is coupled to the UI any way, why not? One thing I've been noodling on lately is flipping it. Where component has the hook tacked on it.
I took the idea described above and tried to capture it in in a new blog post, Compound Components with a Hook