3 ms·
Can you use react components with it? All the libraries of beautiful components are the main reason why I use react. Like I know you can but with cross componen
by grizzles 6y ago
Can you use react components with it? All the libraries of beautiful components are the main reason why I use react. Like I know you can but with cross component comms and stuff.
Does the state thing have the same gotchas as react hooks? Not a big fan of how that's impl'd in react.
- ryansolid 6y agoNo Hook Rules. Hooks are an amazing feat by the React team as they basically come so close to emulating the behavior here with running through top-down VDOM reconciliation. But they can't be nested etc.. This reactive approach is similar to MobX or Vue Composition API and doesn't have those constraints. That being said for the same reason. No React Compat. The library doesn't work even remotely similar. People have used them together, but this is no straight swap in.
- grizzles 6y agoMight be a good feature. One idea might be a standard way of wrapping a react component so that it uses an embedded iframe / postmessage to post messages back and forth with solid. Tho personally I would like to see this approach to managing state win: https://github.com/colshacol/storage-changed https://github.com/colshacol/storage-changed
- ryansolid 6y agoSolid doesn't re-render Components over and over.. so integrating React is as simple as wrapping a `createEffect` calling `React.render` on a ref. The other way around is a bit harder, but been at this for a while here is a codesandbox with a HOC for that: https://codesandbox.io/s/solid-react-hoc-8m2yd https://codesandbox.io/s/solid-react-hoc-8m2yd If anything there is just so much to document.
- grizzles 6y agoAny comment on that storage-changed lib? I think that's a massively underrated abstraction for high level state / comms. I want it to be more popular. :)
- ryansolid 6y agoIt's interesting to wrap the persistence in there as well and it's lightweight so that's a plus. But someone also could use say Redux(or Storeon) and achieve a similar thing. The challenge of interopt is more with conflicting update/render cycle and props (especially children). For global storage any event emitter will do. Although one so browser native definitely has it's perks.