October 2017
Intermediate to advanced
302 pages
7h 27m
English
Let's confirm that React is in our project by using it to render a simple element to our screen. This will be our first dipping of our feet into React, so go slow and ensure that you understand each step.
First, we need to import our React package (which we just installed with yarn) into our index.html so that we can use it there.
To do this, we add a <script> tag with the path to the main React file within our node-modules folder. This tag looks like this:
<script src="../node_modules/react/dist/react.js"></script>
Place this in your index.html, at the bottom of the body tag (before the closing </body>).
Okay, we have React! Let's use it to make a simple <h1> tag, just like the one we wrote in HTML.
React has a function called ...
Read now
Unlock full access