Fork me on GitHub
#rum
<
2018-07-06
>
mattly15:07:56

I'm building a react native app with Rum, and using PanResponder to handle gesture input. I create a PR at component-will-mount time and assign it to the component's state, but one of the callbacks needs to access the current props of the component. Is there an easy way to get that or should I resign myself to doing something like this: (-> state :rum/react-component .-props js->clj (get ":rum/initial-state") :rum/args first)

Niki20:07:08

I think js->clj is an overkill here. Just use JS property accessor (gobj/get or smth like that)

Niki20:07:55

but I don’t understand, you need to get to the rum state from rum component, why go all this way around? state is already passed into callbacks?

mattly20:07:12

it's not a react component callback, it's a PanResponder callback

mattly20:07:45

PanResponder is a RN API for dealing with gestures

mattly20:07:11

so you can use it alongside a component for doing stuff like drag and drop