Fork me on GitHub
#reagent
<
2019-08-22
>
pmooser16:08:38

I am trying to wrap a react component (react-grid-layout) in a reagent compnent. The react component stores its state in a property called "state" - ideally, I would be able to store/update this state in an atom instead.

pmooser16:08:44

Does anyone know of any examples where someone has done something like this?

pmooser16:08:59

I don't fully understand react property updating so I'm struggling a little bit.

pmooser16:08:56

I'm guessing I have to intercept a potential prop change to my atom using componentWillReceiveProps and then forward that to the underlying react component.

David Pham16:08:07

Did you check the function current-component in reagent?

David Pham16:08:39

My experience with material-ui is you can actually store the state in a ratom and check if rerendering your component is fast enough

pmooser16:08:24

@neo2551 I will take a look - thank you.

Lone Ranger22:08:00

does anyone happen to know a reference for rules on when reactions and ratoms are recalculated?