There is more JavaScript than React
Final notes by the author to his readers!
We'll cover the following...
In conclusion, there is lots of JavaScript which can be harnessed in React. Whereas React has only a slim API surface area, developers have to get used to all the functionalities JavaScript has to offer. The saying is not without any reason: “being a React developer makes you a better JavaScript developer”. Let’s recap some of the learned aspects of JavaScript in React by refactoring a higher-order component.
Press + to interact
function withLoading(Component) {return class WithLoading extends {render() {const { isLoading, ...props } = this.props;if (isLoading) {return <p>Loading</p>;}return <Component { ...props } />;}}};}
This higher-order component is only used for ...