Introduction to React
Explore the fundamentals of React by understanding its component-based structure, JSX syntax, and styling approach. This lesson helps you set up React projects, build interactive client interfaces, and grasp why React is ideal for creating modular, scalable front end applications.
We'll cover the following...
What is a React Application?
In the past, creating a web page involved putting together enough HTML markup to make the page look right and then styled using CSS. Later, Bootstrap and other libraries became popular for creating professional-looking pages with consistent styling. To create interactive user interfaces, the developer must use JavaScript, which is well suited to event-driven programming, where you can create and pass a function to be called when a particularly interesting thing happens.
It’s with these precedences that an ecosystem of libraries evolved to make front-end development easier. However, creating front-end web applications still posed a challenge. A simpler, modular, and more scalable approach to building front-ends was needed. To address this, Facebook released React in 2013.
React is organized by components (special JavaScript classes) that render HTML. Each rendering can include other components.
Why React is a Good Choice
In this course, we focus exclusively on React for the following reasons:
-
For the purposes of this course, one framework is enough. Going back and forth between frameworks may become confusing.
-
React has a handful of concepts that we need need to know to get going. This easier learning curve makes React a good choice for a quick start guide like this one.
-
One of the main objections to React is its use of the JSX dialect of JavaScript. However, this language allows us to put our HTML code directly into our JavaScript code in a readable and modifiable way, resulting in fewer files and simpler projects. Along these lines, we also use styled components to place CSS styles directly in the code.
-
React has a thriving community. Some projections suggest it will overtake Angular and become the most popular front-end JavaScript framework in the next couple of years.