capitalize header 4s (#22851)
This commit is contained in:
committed by
Manish Giri
parent
aa2adb9338
commit
9fb5629b51
@ -29,7 +29,7 @@ npm start
|
|||||||
Start up your editor or IDE of choice and edit the `App.js` file in the `src` folder. When created with the `react-create-app` tool, there will already be some code in this file.
|
Start up your editor or IDE of choice and edit the `App.js` file in the `src` folder. When created with the `react-create-app` tool, there will already be some code in this file.
|
||||||
|
|
||||||
The code will consist of these parts:
|
The code will consist of these parts:
|
||||||
#### imports
|
#### Imports
|
||||||
```JavaScript
|
```JavaScript
|
||||||
import React, { Component } from 'react';
|
import React, { Component } from 'react';
|
||||||
import logo from './logo.svg';
|
import logo from './logo.svg';
|
||||||
@ -41,7 +41,7 @@ This is used by [webpack](https://webpack.js.org/) to import all required module
|
|||||||
2) `logo`, which allows us to use `logo.svg` in this file.
|
2) `logo`, which allows us to use `logo.svg` in this file.
|
||||||
3) `./App.css`, which imports the stylesheet for this file.
|
3) `./App.css`, which imports the stylesheet for this file.
|
||||||
|
|
||||||
#### classes/components
|
#### Classes/Components
|
||||||
```JavaScript
|
```JavaScript
|
||||||
class App extends Component {
|
class App extends Component {
|
||||||
render() {
|
render() {
|
||||||
@ -65,7 +65,7 @@ There is already 1 component created, the `App` component. If you used the `crea
|
|||||||
|
|
||||||
We will look at components more detailed in next chapters.
|
We will look at components more detailed in next chapters.
|
||||||
|
|
||||||
#### exports
|
#### Exports
|
||||||
When creating a class in react, you should export them after declaration, which allows you to use the component in another file by using the `import` keyword. You can use `default` after the `export` keyword to tell React that this is the main class of this file.
|
When creating a class in react, you should export them after declaration, which allows you to use the component in another file by using the `import` keyword. You can use `default` after the `export` keyword to tell React that this is the main class of this file.
|
||||||
|
|
||||||
```JavaScript
|
```JavaScript
|
||||||
|
Reference in New Issue
Block a user