Functional Programming in React
Functional programming is a very broad topic, the basic definition of functional programming is a way of organizing our code base such that we minimize mutation and state change in our applications, we keep our functions independent of external data, this is something called pure functions, and we also treat functions as first-class citizens. Let's have a look at some of the main examples of functional programming in React.
1. Controlled components
The idea of Controlled components is that we can get the component into any state we want simply by passing in the right props. So the component isn't keeping track of its own state, and that's a pretty functional concept there.
2. Higher order components
A higher-order component is an example of functional programming because they're functions that return other functions, which is an application of something called first-class functions.
...... more to come