Installing React

First, we have to go to https://reactjs.org/ and see the latest available version that we will use in our application:

As of writing this book, the latest version available is v16.0.0. We will use CDN React packages in this chapter to build our application:

<script crossorigin src="https://unpkg.com/react@16/umd/react.development.js"></script>
<script crossorigin src="https://unpkg.com/react-dom@16/umd/react-dom.development.js"></script>

The preceding versions are only meant for development, and that is not suitable for production. To use minified and optimized production versions, we need to use these production packages:

<script crossorigin src="https://unpkg.com/react@16/umd/react.production.min.js"></script>
<script crossorigin src="https://unpkg.com/react-dom@16/umd/react-dom.production.min.js"></script>

If you want to use a different version, replace number 16 with the version that you want to use in your app. Let's include development version CDN into your HTML:

<!doctype html>
<html class="no-js" lang="">
<head>
<meta charset="utf-8">
<title>ReactJs and Firebase - Chapter 2</title>
<script crossorigin
src="https://unpkg.com/react@16/umd/react.development.js">
</script>
<script crossorigin src="https://unpkg.com/react-dom@16/umd/react-
dom.development.js"></script>
</head>
<body>
<!-- Add your site or application content here -->
<p>Hello world! This is Our First React App with Firebase.</p>
</body>
</html>
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset