Fork me on GitHub
#reagent
<
2016-10-10
>
lxsameer08:10:56

hey folks, how should I implement a sidebar component in theory ?

lxsameer08:10:20

the sidebar trigger is my concern ?

plexus16:10:37

what, exactly is your concern? the sidebar being visible is part of your app state, so you would dispatch an event that shows/hides it

plexus16:10:58

:on-click #(dispatch [:toggle-sidebar])

plexus16:10:36

(reg-event-db :toggle-sidebar (fn [db _] (update db :show-sidebar not)))

plexus16:10:29

oh, sorry thought this was the re-frame channel 🙂 in vanilla reagent it depends how you're handling your app state

plexus16:10:45

if you have a single state atom you could do

plexus16:10:14

:on-click #(swap! app-state update :show-sidebar not)

plexus16:10:22

does that help? not sure if that answers your question...

colindresj22:10:17

Hello all, what’s the best way to pass different (read additional) props to child elements in Reagent? In react we have React.cloneElement, but don’t see anything that would offer similar functionality in Reagent

mattsfrey23:10:34

has anyone encountered the issue where your events set to components i.e. a [: div {on-click... just aren't making it into the dom?

mattsfrey23:10:53

(this issue only seems to be happening on MS Edge for me)