Web developers working for Zühlke since 2013
made with reveal.js
Follow the presentation here
React is a library, not a framework.
It handles rendering and state, but leaves other things like ajax and routing up to you.
Fortunately, thanks to the huge community, there are always many options to choose from.
$ mkdir react-component && cd react-component
$ touch index.html
$ touch MyComponent.js
index.html
<div id="container"></div>
<script src="https://unpkg.com/react@16/umd/react.development.js" crossorigin></script>
<script src="https://unpkg.com/react-dom@16/umd/react-dom.development.js" crossorigin></script>
<script src="MyComponent.js"></script>
MyComponent.js
function MyComponent() {
return React.createElement(
'h1',
{},
'Hello Component!'
);
}
const container = document.querySelector('#container');
const element = React.createElement(MyComponent);
ReactDOM.render(element, container);