Đăng Tú
Explore posts from serversAny tip/checklist to debug Solid components when it refuses to react the signal changed?
https://github.com/solidjs/solid/discussions/2336
Here is the repo I stuck:
https://gitlab.com/ndt-leisure/mangodex
So basically this is a Tauri 2 + Bun + Vite + SolidJs project (it meant for testing Tauri 2 and practice on SolidJs). Everything seems to work ok with simple case but soon I got myself in a situation where a solid component didn't get rendered when the signal value changed. So far I have done these things but it doesn't tell me anything much:
check console.log in tauri linux desktop app → no error found
log the signal value through createEffect → the value is printed out properly
because 1 of my signal is an object so I thought maybe I used wrong function for it. Therefore, I replace createSignal with createStore → the result is no better
it's not like the component never work. Sometime it works, but not from starting the app, it from hot reload of updating a part of my code (usually by adding console log a signal)
I'm still learn Solid so there are many things I didn't know much. Is there any debug checklist I should check for this case? Maybe if you can look at the code of mine and give me a few pieces of thought please? (all the solid frontend code is in /src/)
Thanks in advanced
9 replies
`createEffect` doesn't working in `input.addEventListener('change')`
Here is source link: https://gitlab.com/ndt-challenge/dev.to/1st/-/blob/main/Glam%20Up%20My%20Markup/form.js?ref_type=heads
Here is demo link: https://ndt-challenge.gitlab.io/dev.to/1st/glam-up-my-markup/
The
createEffect
seems to work fine expect when I try to set signal inside the input change event. What should I do to debug this case?
Update to add more info:
In the demo link, you will see the bug very clear when you try to update the select input. The expect way is the reset button should be change from disabled to not disabled.17 replies