sokratis
sokratis
Explore posts from servers
SSolidJS
Created by sokratis on 4/30/2024 in #support
Calling root render multiple times
Thanks a lot Alex! That's super helpful.
13 replies
SSolidJS
Created by sokratis on 4/30/2024 in #support
Calling root render multiple times
Spot on! The store is effectively the external channel we need to trigger reactivity.
13 replies
SSolidJS
Created by sokratis on 4/30/2024 in #support
Calling root render multiple times
You can have a look at the POC if you want https://github.com/SokratisVidros/solid_components_poc
13 replies
SSolidJS
Created by sokratis on 4/30/2024 in #support
Calling root render multiple times
Hey Alex. Thanks for the detailed response.I am familiar with the rendering logic of Solid, and I love it. Let me explain my use case and why I need such a pattern. My team and I are working on building UI components, which are served via a VanillaJS SDK. We are in the process of evaluating which internal UI framework we will use. Solid is winning for now. The reason I need such behavior is the following. Imagine an SDK that does window.MySDK.mountFoo(el, props). This method renders a Foo UI (built with Solid) inside el. Currently, I am exploring how multiple invocations of window.MySDK.mountFoo(el, props) with the same el and different props should behave. As you said, by default, SolidJS will just append a new Foo UI in el. However, I feel DX's better if it updates the existing FooUI with different props. There is a workaround by making the mount method smarter, comparing props, and triggering an event that is converted to a signal. I was just wondering if there is an easier way.
13 replies