-
|
Reproduction repository:https://github.com/SaekiRaku/why-solid-not-reactive-when-use-umd I bundled a Solid component into an UMD module, and import it in a vite project. I used it like this: But inside 🙏Please help, thanks.
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
I figured it out by myself. I need to configure solid-js in externals and then provide the solid-js dependency/instance used in the vite project when importing. I misunderstood that solid-js compiles reactive operations into dom operations, mistakenly thinking that all operations are compiled and there's no need for an independent runtime like React. It seems that solid-js shares some context in terms of signals to achieve reactivity, so the same solid-js instance must be used. |
Beta Was this translation helpful? Give feedback.

I figured it out by myself. I need to configure solid-js in externals and then provide the solid-js dependency/instance used in the vite project when importing. I misunderstood that solid-js compiles reactive operations into dom operations, mistakenly thinking that all operations are compiled and there's no need for an independent runtime like React. It seems that solid-js shares some context in terms of signals to achieve reactivity, so the same solid-js instance must be used.