S
SolidJS•3y ago
musiclover

I have too long Switch, Match

Is there any alternative in this case? I have 50 components to match..
6 Replies
lxsmnsyc
lxsmnsyc•3y ago
if the it's just integers then maybe an array? like elements[value]()
musiclover
musicloverOP•3y ago
I thought same solution, but it doesn't work. re-render when changing singnal..
deluksic
deluksic•3y ago
SolidJS
Solid is a purely reactive library. It was designed from the ground up with a reactive core. It's influenced by reactive principles developed by previous libraries.
musiclover
musicloverOP•3y ago
Thanks delu. Yes, it works really well. I should use MyComponent, instead <MyComponent /> to use inside options..:)
deluksic
deluksic•3y ago
Glad I could help 🙂
fabiospampinato
fabiospampinato•3y ago
Potentially you can also just have a single createMemo and put the logic in there 🤔
Want results from more Discord servers?
Add your server