Beginning ReactJS Foundations Building User Interfaces with ReactJS
An Approachable Guide
Chris Minnick
- English
- ePUB (mobile friendly)
- Available on iOS & Android
Beginning ReactJS Foundations Building User Interfaces with ReactJS
An Approachable Guide
Chris Minnick
About This Book
Quickly learn the most widely used front-end development language with ease and confidence
React JS Foundations: Building User Interfaces with ReactJS - An Approachable Guide walks readers through the fundamental concepts of programming with the explosively popular front-end tool known as React JS.
Written by an accomplished full-stack engineer, speaker, and community organizer, React JS Foundations teaches readers how to understand React and how to begin building applications with it. The book:
- Explains and clarifies technical terminology with relevant and modern examples to assist people new to programming understand the language
- Helps experienced programmers quickly get up to speed with React
- Is stocked throughout with practical and applicable examples of day-to-day React work
Perfect for beginner, intermediate, and advanced programmers alike, React JS Foundations will quickly bring you up to speed on one of the most useful and widely used front-end languages on the web today. You can start building your first application today.
Frequently asked questions
Information
1
Hello, World!
- How to use React without a toolchain.
- How to write your first React application.
- How to make and modify a React application built with Create React App.
REACT WITHOUT A BUILD TOOLCHAIN
- Create a new folder in your Documents folder and open it in Visual Studio Code.
- Open the Command Palette (Command+Shift+P on MacOS or Control+Shift+P on Windows) and run the File: New File command, or select File âȘ New File from the top menu.
- Save your new file as
index.html
. - Type ! followed by the Tab key to generate an HTML template using emmet. If you prefer, you can also type the following code into your new blank file:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Hello, React!</title>
</head>
<body>
</body>
</html>
- Between the
<body>
and</body>
tags, create an emptydiv
element and give it anid
attribute with the value ofapp
. This is where you're going to tell React to render its output. In the React world, we call this the container element. The actualid
value doesn't matter here, butapp
is a simple, easy to remember, and meaningful value that is very commonly used.NOTE You can put a React container element anywhere inside thebody
element of a web page. - Go to
https://reactjs.org/docs/cdn-links.html
in your browser and find the script tags for including React and ReactDOM from a content delivery network (CDN), as shown in Figure 1-1. - Copy both script tags and paste them right before the
</body>
tag inindex.html
.NOTE The reason these must go at the end of the body of your web page is that they can make changes to your web page. Because of the way JavaScript loads and then executes immediately after it loads, the browser will show an error message if your React code is loaded and executed before the container element is loaded.The first script,react.development.js
, is the actual React library that handles the rendering of React components, the flow of data between components, responding to events, and all of the func...