If you have exposure to react you have probably heard of life cycles. To understand react lifecycles, let’s understand how a web application generally behaves. If you want to briefly summarize how a web page runs from beginning to end, here is how it’s like: before rendering rendering listening for changes to state or props finish rendering
If you have exposure to react you have probably heard of life cycles.
To understand react lifecycles, let’s understand how a web application generally behaves.
If you want to briefly summarize how a web page runs from beginning to end, here is how it’s like:
Ultimately, when you go to facebook and see a bunch of posts, the web application actually makes an api to retrieve those posts before rendering.
Afterward, the application renders this piece of information(via render function). It listens to any changes or events that affect the state or props. When the state or the props of any components changes, the application gets re-rendered.
In react terms, they are represented in this diagram:
There are several lifecycles that affect how components are being rendered:
Article covers: How native is react native?, React Native vs (Ionic, Cordova), Similarities and difference between React Native and Native App Development.
Lifecycle of Components. Each component in React has a lifecycle which you can monitor and manipulate during its three main phases.
React Component Lifecycle Methods-How They Translate Into React Hooks. This article provides an explanation of some of the most useful Lifecycle methods, before showing how to translate these methods into React Hooks.
For working with any tech you must know the lifecycle. When writing React components, we need access to lifecycle events to handle a variety of side effects: like fetching data on mount, changing props when the component updates, cleaning up before the component unmounts, etc.