Fork me on GitHub

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.


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


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


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


@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?