DEV Community

loading...

Discussion on: Explain React.js Like I'm Five

Collapse
lexlohr profile image
Alex Lohr

React is a tiny part of a set of libraries that solve certain problems for web apps. It provides a way to create a hidden representation of the app and manage its state to have the actual changes be then put into the browser window by React.DOM.

React also allows apps to be split into reusable components. Each of those has its own state which is kept inside and properties from outside. The state is managed by the component itself. The properties are managed by whatever part of the app includes the component (or some other solution to manage the overall state of the application, for example Redux, but that's a story for another day). Whenever one of them changes, the hidden representation gets updated and is then compared with the visible app. Only those parts that changed get updated, which saves some time.

Because it is easier to write, the hidden representation is no longer written in plain javascript, but in an extension of the language called "JSX", which allows using HTML tags inside javascript files and is then transformed back into javascript.

Collapse
tiffanywismer profile image