handle add sum

@JavaScript here is a support post for your question
8 Replies
jesseb34r
jesseb34rOP2mo ago
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 function
jesseb34r
jesseb34rOP2mo ago
Solid Playground
Quickly discover what the solid compiler will generate from your JSX template
jesseb34r
jesseb34rOP2mo ago
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
jesseb34r
jesseb34rOP2mo ago
Solid Playground
Quickly discover what the solid compiler will generate from your JSX template
jesseb34r
jesseb34rOP2mo ago
if you want to use the html value attribute you could use an event handler that gets the value from the event target
jesseb34r
jesseb34rOP2mo ago
Solid Playground
Quickly discover what the solid compiler will generate from your JSX template
jesseb34r
jesseb34rOP2mo ago
this version with the custom component that handles this is probably the most idiomatic solid way to do it use props and signals etc
JavaScript
JavaScript2mo ago
ok Thanks a ton

Did you find this page helpful?