ringsig
Dependency on `window`?
I'm using
babel-preset-solid
and for some reason the generated output has a dependency on window
:
This makes my library unusable in server-rendered environments.
Why does this happen and how do I get rid of this dependency?10 replies
Uncaught TypeError: _tmpl$6 is not a function
I'm trying to create a library that exposes a web component that's implemented internally with Solid.js. I'm using Rollup with rollup-preset-solid to bundle the library as an ESModule, but when I try to consume the library I get this error.
This is my rollup config file:
Online research suggests that this is because of improper JSX compilation, but I'm not sure what I'm doing wrong. Any ideas?
2 replies
Best way to implement a dialog in Solid.js
I'm using Solid.js for a library and need to implement a dialog to capture some user input (say, a selection from a set of multiple options). I want to provide a function that will display the dialog and return a promise that will resolve with the result of the dialog (e.g. the option the user selected). What's the best way to go about this?
What I have in mind is to render the dialog and add an event handler for an option being selected that will resolve the promise and destroy the dialog. However, I can't figure out how I should destroy it.
Is there a better method I'm missing?
10 replies
Component doesn't react to changes in Signal
Hi! So I'm not sure why but my component is not reacting when a Signal changes.
The signal is defined globally:
This is my
App.tsx
file:
The Signal is set in some event handler from a third-party library.
The effect runs and prints the new authState
when it updates, but the actual component/markup itself just refuses to update it.
I tried directly calling setAuthState
and that somehow works, but inside a timeout or a third-party event handler, it doesn't.
Any clues?2 replies
Listening to all changes in an array or object in a store
Hi! I have a store that has arrays and objects inside it. I want to listen to all changes in a tree.
For instance, suppose this is my store:
and I want to use the
on
helper to listen to this array such that whenever array
, array[n]
or array[n].name
changes, my effect will be called.
Is there some way to do that?12 replies