Stateless functions
One fundamental and efficient solution for writing well-structured and reusable React components is the use of stateless functions.
As you might expect, stateless functions are functions, not React components. They are not able to store any states; only properties can be used to pass and render data. Property updates are directly rerendered inside of the stateless functions, and cannot be handled by the componentWillReceiveProps method, as in React components.
We have written a lot of code where stateless functions can be used very easily; while doing so, we have also structured and improved the readability of our React application.
Beginning with the file structure, we will create a new folder for our new components (or ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access