diff --git a/02_Day_Introduction_to_React/02_introduction_to_react.md b/02_Day_Introduction_to_React/02_introduction_to_react.md index 6c2363a..ebec523 100644 --- a/02_Day_Introduction_to_React/02_introduction_to_react.md +++ b/02_Day_Introduction_to_React/02_introduction_to_react.md @@ -25,14 +25,14 @@ - [React vs Vue popularity in February 2020](#react-vs-vue-popularity-in-february-2020) - [3. JSX](#3-jsx) - [JSX Element](#jsx-element) - - [Commenting JSX element](#commenting-jsx-element) - - [Rendering JSX Element](#rendering-jsx-element) + - [Commenting a JSX element](#commenting-a-jsx-element) + - [Rendering a JSX Element](#rendering-a-jsx-element) - [Style and className in JSX](#style-and-classname-in-jsx) - - [Injecting data to JSX Element](#injecting-data-to-jsx-element) - - [Injecting a string to JSX Element](#injecting-a-string-to-jsx-element) - - [Injecting a number to JSX Element](#injecting-a-number-to-jsx-element) - - [Injecting an array to JSX Element](#injecting-an-array-to-jsx-element) - - [Injecting an object to JSX Element](#injecting-an-object-to-jsx-element) + - [Injecting data to a JSX Element](#injecting-data-to-jsx-element) + - [Injecting a string to a JSX Element](#injecting-a-string-to-a-jsx-element) + - [Injecting a number to a JSX Element](#injecting-a-number-to-a-jsx-element) + - [Injecting an array to a JSX Element](#injecting-an-array-to-a-jsx-element) + - [Injecting an object to a JSX Element](#injecting-an-object-to-a-jsx-element) - [Exercises](#exercises) - [Exercises: What is React?](#exercises-what-is-react) - [Exercises: Why React?](#exercises-why-react) @@ -44,33 +44,33 @@ ## Getting Started React -Prerequisite to get started with React. You should have a good understanding of the following technologies: +This section covers prerequisites to get started with React. You should have a good understanding of the following technologies: - HTML - CSS - JavaScript -If you have the above skills you will enjoy doing React. The 30 Days Of React challenge contains anything you need to know about react. In every section, it has some exercises and mini-projects and it is recommended to work on them. This 30 Days Of React challenge will help you learn the latest version of React and the old version step by step. The topics are broken down into 30 days, where each day contains several topics with easy-to-understand explanations, real-world examples and many hands on exercises. +If you have the skills mentioned above, you will enjoy doing React. The 30 Days Of React challenge contains everything you need to know about react. In every section, it has some exercises and mini-projects, and it is recommended to work on them. This 30 Days Of React challenge will help you learn the latest version of React and the old version, step by step. The topics are broken down into 30 days, where each day contains several topics with easy-to-understand explanations, real-world examples and many hands-on exercises. This challenge is designed for beginners and professionals who want to build a web application using React and JavaScript. ### 1. What is React? -React is a JavaScript library for building a reusable user interface(UI). It was initially released on May 29, 2013. The current version is 16.13.1 and somehow it is stable. React was created by Facebook. React makes creating UI components very easy.The official React documentation can be found [here](https://reactjs.org/docs/getting-started.html). When we work with React we do not interact directly with the DOM. React has its own way to handle the DOM(Document Object Model) manipulation. React uses its virtual DOM to make a new change and it updates only the element that needs change. Do not directly interact with DOM when you build a React Application and leave the DOM manipulation job for the React virtual DOM. In this challenge, we will develop 10-15 web applications using React. A web application or a website is made up of buttons, links, forms with different input fields, header, footer, sections, articles, texts, images, audios, videos and boxes with different shapes. We use react to make a reusable UI component of a website. +React is a JavaScript library for building a reusable user interface(UI). It was initially released on May 29, 2013. The current version is 16.13.1 and somehow it is stable. React was created by Facebook. React makes creating UI components very easy. The official React documentation can be found [here](https://reactjs.org/docs/getting-started.html). When we work with React we do not interact directly with the DOM. React has its own way to handle the DOM(Document Object Model) manipulation. React uses its virtual DOM to make new changes and it updates only the element, that needs changing. Do not directly interact with DOM when you build a React Application and leave the DOM manipulation job for the React virtual DOM. In this challenge, we will develop 10-15 web applications using React. A web application, or a website, is made of buttons, links, forms with different input fields, header, footer, sections, articles, texts, images, audios, videos and boxes with different shapes. We use react to make a reusable UI components of a website. To summarize: - React was released in May 2013 - React was created by Facebook - React is a JavaScript library for building user interfaces -- React is used to build single page applications- An application which has only one HTML page. +- React is used to build single page applications - An application which has only one HTML page. - React allows us to create reusable UI components - React latest release is 16.13.1 - [React versions](https://reactjs.org/versions/) -- React official documentation can be found [her](https://reactjs.org/docs/getting-started.html) +- React official documentation can be found [here](https://reactjs.org/docs/getting-started.html) ### 2. Why React? -React is one of the most popular JavaScript library. Many developers and companies have been using it for the last couple of years. Its popularity has been growing fast and it has a huge community. How do we measure popularity? One measure of popularity could be GitHub repository stars, watchers and forks. Let us compare the popularity of [React](https://github.com/facebook/react) and [Vue](https://github.com/vuejs/vue). As of today, the popularity between the two most popular JavaScript looks like as shown on the diagram. From the diagram, you can speculate the most popular JavaScript library. You may look at the number of watchers, stars and forks for both React and Vue. These alone will not be a very good measure of popularity but still it tells a little bit about the popularity of the two technologies. If I have to recommend another JavaScript library next to React would Vue.js. +React is one of the most popular JavaScript libraries. Many developers and companies have been using it for the last couple of years. Its popularity has been growing fast and it has a huge community. How do we measure popularity? One measure of popularity could be GitHub repository stars, watchers and forks. Let us compare the popularity of [React](https://github.com/facebook/react) and [Vue](https://github.com/vuejs/vue). As of today, the popularity between the two most popular JavaScript looks like as shown on the diagram. From the diagram, you can speculate the most popular JavaScript library. You may look at the number of watchers, stars and forks for both React and Vue. These alone will not be a very good measure of popularity, but still it tells a little bit about the popularity of the two technologies. If I have to recommend another JavaScript library next to React, it would be Vue.js. #### React vs Vue popularity in October 2020 @@ -92,7 +92,7 @@ Vue Official GitHub Repository ![Vue Popularity February 2020](../images/vue_popularity.png) -Why we choose to use react ? We use react because of the following reasons: +Why we choose to use React ? We use it because of the following reasons: - fast - modular @@ -104,7 +104,7 @@ Why we choose to use react ? We use react because of the following reasons: ### 3. JSX -JSX stands for JavaScript XML. JSX allows us to write HTML elements with JavaScript code. An HTML element has an opening and closing tag, content, and attribute in the opening tag. However, some HTML tag may not have a content and a closing tag, they are self closing elements. To create HTML elements in React we do not use the _createElement()_ instead we just use JSX elements. Therefore, JSX makes it easier to write and add HTML elements in React. JSX will be converted to JavaScript on browser using transpiler which [babel.js](https://babeljs.io/). Babel is a library which transpile JSX to pure JavaScript and latest JavaScript to older version. See the JSX code below. +JSX stands for JavaScript XML. JSX allows us to write HTML elements with JavaScript code. An HTML element has an opening and closing tags, content, and attribute in the opening tag. However, some HTML elements may not have content and a closing tag - they are self closing elements. To create HTML elements in React we do not use the _createElement()_ instead we just use JSX elements. Therefore, JSX makes it easier to write and add HTML elements in React. JSX will be converted to JavaScript on browser using a transpiler - [babel.js](https://babeljs.io/). Babel is a library which transpiles JSX to pure JavaScript and latest JavaScript to older version. See the JSX code below. ```js // JSX syntax @@ -115,25 +115,25 @@ const welcome =