8 Replies
there are a few ways you could handle this in solid
if are cool with writing the values manually for the button you could just use a signal to track state and update in a
setSignal
call in the onClick
functionSolid Playground
Quickly discover what the solid compiler will generate from your JSX template
If you want to have the click handler use a value on the button you could track that in the component instead of with the value
Solid Playground
Quickly discover what the solid compiler will generate from your JSX template
if you want to use the html value attribute you could use an event handler that gets the value from the event target
Solid Playground
Quickly discover what the solid compiler will generate from your JSX template
this version with the custom component that handles this is probably the most idiomatic solid way to do it
use props and signals etc
ok
Thanks a ton