Once we have finished creating the folder structure, we need to install both our frameworks, ReactJS and Bootstrap. It's as simple as including JavaScript and CSS files in your page. We can do this via a Content Delivery Network (CDN), such as Google or Microsoft, but we are going to fetch the files manually in our application so we don't have to be dependent on the Internet and can work offline.
First, we have to go to this URL https://facebook.github.io/react/ and hit the Download React v15.1.0 button:
This will give you a ZIP file of the latest version of ReactJS that includes ReactJS library files and some sample code for ReactJS.
For now, we will only need two files in our application: react.min.js
and react-dom.min.js
from the build
directory of the extracted folder.
Here are a few steps we need to follow:
react.min.js
and react-dom.min.js
to your project directory, the chapter1/js
folder, and open up your index.html
file in your editor.head
tag section:<script type="text/js" src="js/react.min.js"></script> <script type="text/js" src="js/react-dom.min.js"></script>
head
tag section will look like this:
<script type="text/js" src="js/react.min.js"></script> <script type="text/js" src="js/react-dom.min.js"></script> <script type="text/js" src="js/browser.min.js"></script>
Here is what the final structure of your js
folder will look like: