Now that we have explored quite a lot regarding ReactJS, there might be queries in your mind about how to architecture a react component or more broadly a react application as a whole. There are no ground rules that have been set, which is ideal while writing an application based on ReactJS. However, if we dig into the tutorials by the Facebook documentation team, hyperlink https://facebook.github.io/react/docs/tutorial.html, we will be able to understand the underlying way they have used while writing such an app.
Let's explore first how a component is structured mostly:
The component
declaredData
is fetched from the server [if required].The
propTypes
of the component are declared [used for validations].Component lifecycle methods [
componentWillMount
,componentDidMount
,componentDidUpdate
,componentWillUnmount
, and so on] are defined.Within each of these lifecycle methods, the functions of these methods are either declared or called internally from another JS functions...