Decisions, decisions.

Writing a simple ClojureScript behavior that changes the size of a div on click.

Nice and easy: add an onClick event watcher. But then what?

Is it better to use js interop to access the event target and the style, or have the div deref a reagent atom (which sets the style) and use the onClick function to update the atom?

Either way achieves the result, but the first feels more portable, while the latter makes much better use of reagent...

· · Web · 0 · 0 · 1
Sign in to participate in the conversation

Server run by the main developers of the project 🐘 It is not focused on any particular niche interest - everyone is welcome as long as you follow our code of conduct!