React
I've been using react since 2017, first for variaous client projects, and then teaching to various organisations including BBC News.
React is a JavaScript library for building user interfaces. It allows the front end to React to changes in state. It guarantees that the interface will always be correct as the state changes. It does this by re=rendering the entire app for every state change. This is possible thanks to the Virtual DOM (tm) which is a code-only representation of the DOM. Changes to the virtual DOM can be batched together, meaning that the actual DOM can be redrawn only when needed.
The React Course
The React course was originally buiilt for BBC News some time ago. It is rather short and could do with an update. I hope one day soon to have time to improve it.
- React Course
- React Course Book (the whole course formatted as a single document with internal links)
-
Passing additional props to React children with React.Children.map
React components are supposed to be modular and stackable, just like html. We achieve nesting in React components by passing children as an implicit prop to our component, but what if we want to do more than simply dump those children on to the page? What if we want to manipulate them in some way? Enter React.Children.map