I'm not sure if there's as much of a need for controlled components in Solid compared to in React, but if we do want to do it this way then it seems like Kobalte actually does this as well so I cheated and used their createControllableSignal as inspiration.
The more I read about Solid's reactivity the more I want to go back to React tbh but oh well lol. I feel like the Solid docs don't do a very good job of explaining why or how stuff works but maybe that's just me lacking experience with it.
It's been a while since I worked on this but I figured I should get this up again.
I've been reading into Solid a bit more and it seems like you generally want to pass values instead of signals/accessor functions in order to make fine-grained reactivity possible. This is why the Solid plugin complained in the case of
useControllableState
. Some reading material on this: https://github.com/solidjs/solid/discussions/749#discussioncomment-1740120 https://old.reddit.com/r/solidjs/comments/18dyxsb/why_not_pass_accessor_function_to_child_components https://dev.to/this-is-learning/thinking-locally-with-signals-3b7h https://github.com/solidjs/solid/issues/2320#issuecomment-2389426057I'm not sure if there's as much of a need for controlled components in Solid compared to in React, but if we do want to do it this way then it seems like Kobalte actually does this as well so I cheated and used their
createControllableSignal
as inspiration.The more I read about Solid's reactivity the more I want to go back to React tbh but oh well lol. I feel like the Solid docs don't do a very good job of explaining why or how stuff works but maybe that's just me lacking experience with it.