Ok so a lot of information. Now let's install React onto our system.
Project Structure
- Create a folder called reactJs.
- Inside that create a myApp folder.
- Inside that create a public folder.
- Inside this folder create an index.html file.
The CDN
React is a JS library so it is available as a CDN (Content Delivery Network).
<html>
<head></head>
<body>
<script src="https://unpkg.com/react@16.0.0/umd/react.development.js"></script>
<script src="https://unpkg.com/react-dom@16.0.0/umd/react-dom.development.js"></script>
</body>
</html>
React needs two libraries to work.
- The first one [react@16.0.0] we have added contains the core syntax of React like createElement() function etc.
- The second one [react-dom@16.0.0] is ReactDOM. This is used to render elements basically.
We will need one more guy called Babel to help us out.
Top comments (0)