Open zthng opened 6 months ago
Not yet, but it will be in the future. I plan to develop a signal-based and framework-agnostic core that can be plugged into framework-specific components.
What you can do today is replace useForm
with useFormStore
and then pass the result to child components.
So technically, I could reimplement the guts of the useFormStore hook and pass it anywhere I guess. I'll try that out 😂
Hello, is it possible to explore decoupling the creation of the signals store from the creation of the components?
Reason: This would enable us to build form modules that are totally isolated from React (with only @preact/signals-react as the only dependency remaining) and to manipulate the form fully outside of React.
Since it is a signal, we can consume it anytime we like anyway—and as such, we can do the bindings between the modules and React ourselves.
This is from the perspective of a large-scale form. Doing this will allow us to break the form into multiple instances without requiring React to have the component rendered somewhere.