File tree Expand file tree Collapse file tree 4 files changed +22
-18
lines changed Expand file tree Collapse file tree 4 files changed +22
-18
lines changed Original file line number Diff line number Diff line change 8
8
"url" : " https://github.com/facebookincubator/create-react-app/issues"
9
9
},
10
10
"scripts" : {
11
- "start" : " node scripts/start.js" ,
12
- "build" : " node scripts/build.js" ,
11
+ "start" : " node scripts/start.js --debug-template " ,
12
+ "build" : " node scripts/build.js --debug-template " ,
13
13
"create-react-app" : " node global-cli/index.js --scripts-version \" $PWD/`npm pack`\" "
14
14
},
15
15
"files" : [
Original file line number Diff line number Diff line change 6
6
< title > React App</ title >
7
7
</ head >
8
8
< body >
9
+ < div id ="root "> </ div >
9
10
<!--
10
11
This HTML file is a template.
11
12
If you open it directly in the browser, you will see an empty page.
Original file line number Diff line number Diff line change 1
- import './App.css' ;
2
- import React from 'react' ;
1
+ import React , { Component } from 'react' ;
3
2
import logo from './logo.svg' ;
3
+ import './App.css' ;
4
4
5
- export default function App ( ) {
6
- return (
7
- < div className = "App" >
8
- < div className = "App-header" >
9
- < img src = { logo } className = "App-logo" alt = "logo" />
10
- < h2 > Welcome to React</ h2 >
5
+ class App extends Component {
6
+ render ( ) {
7
+ return (
8
+ < div className = "App" >
9
+ < div className = "App-header" >
10
+ < img src = { logo } className = "App-logo" alt = "logo" />
11
+ < h2 > Welcome to React</ h2 >
12
+ </ div >
13
+ < p className = "App-intro" >
14
+ To get started, edit < code > src/App.js</ code > and save to reload.
15
+ </ p >
11
16
</ div >
12
- < p className = "App-intro" >
13
- To get started, edit < code > src/App.js</ code > and save to reload.
14
- </ p >
15
- </ div >
16
- ) ;
17
+ ) ;
18
+ }
17
19
}
20
+
21
+ export default App ;
Original file line number Diff line number Diff line change 1
- import './index.css' ;
2
1
import React from 'react' ;
3
2
import { render } from 'react-dom' ;
4
3
import App from './App' ;
4
+ import './index.css' ;
5
5
6
- const rootEl = document . createElement ( 'div' ) ;
7
- document . body . appendChild ( rootEl ) ;
6
+ const rootEl = document . getElementById ( 'root' ) ;
8
7
render ( < App /> , rootEl ) ;
You can’t perform that action at this time.
0 commit comments