S
SolidJS•2y 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•2y ago
if the it's just integers then maybe an array? like elements[value]()
musiclover
musiclover•2y ago
I thought same solution, but it doesn't work. re-render when changing singnal..
deluksic
deluksic•2y 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
musiclover•2y ago
Thanks delu. Yes, it works really well. I should use MyComponent, instead <MyComponent /> to use inside options..:)
deluksic
deluksic•2y ago
Glad I could help 🙂
fabiospampinato
fabiospampinato•2y 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