Fork me on GitHub
#reagent
<
2022-07-23
>
popeye17:07:49

Is there any website, which give us information about using reagent life-cycle Form3 ? I am not getting practical example when to use it! I do not know react as well in this stage now

p-himik17:07:12

Reagent builds on top of React and refers to React's documentation in its own. So I'd recommend just reading about component lifecycle method in React's documentation. There's 1-to-1 mapping with Reagent's form-3 functions.

popeye17:07:08

but I did not getting when to use it in real world scenario

p-himik17:07:57

When you need to call something on the first render, save some state, and then do something with it when the component unmounts, for example. Very handy for interacting with JS components that are React-agnostic. Or when you need to run some code only when a specific property is updated. Or when you need to manually determine whether a change to some prop should result in an update of the component. Or when you need to set up error boundaries. Just go through the methods https://reactjs.org/docs/react-component.html and most of the things will become self-evident.

popeye17:07:06

thanks for this writing 🙂, I will go through it

👍 1
popeye18:07:32

@U2FRKM4TW question , what we can achieve in form-3 which we cannot in form-2

p-himik18:07:40

Everything that I've described above, and more.