mirror of
https://github.com/zhigang1992/create-react-app.git
synced 2026-04-28 09:25:42 +08:00
Tweak conventions and fix example
This commit is contained in:
@@ -8,8 +8,8 @@
|
|||||||
"url": "https://github.com/facebookincubator/create-react-app/issues"
|
"url": "https://github.com/facebookincubator/create-react-app/issues"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "node scripts/start.js",
|
"start": "node scripts/start.js --debug-template",
|
||||||
"build": "node scripts/build.js",
|
"build": "node scripts/build.js --debug-template",
|
||||||
"create-react-app": "node global-cli/index.js --scripts-version \"$PWD/`npm pack`\""
|
"create-react-app": "node global-cli/index.js --scripts-version \"$PWD/`npm pack`\""
|
||||||
},
|
},
|
||||||
"files": [
|
"files": [
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
<title>React App</title>
|
<title>React App</title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
<div id="root"></div>
|
||||||
<!--
|
<!--
|
||||||
This HTML file is a template.
|
This HTML file is a template.
|
||||||
If you open it directly in the browser, you will see an empty page.
|
If you open it directly in the browser, you will see an empty page.
|
||||||
|
|||||||
@@ -1,17 +1,21 @@
|
|||||||
import './App.css';
|
import React, { Component } from 'react';
|
||||||
import React from 'react';
|
|
||||||
import logo from './logo.svg';
|
import logo from './logo.svg';
|
||||||
|
import './App.css';
|
||||||
|
|
||||||
export default function App() {
|
class App extends Component {
|
||||||
return (
|
render() {
|
||||||
<div className="App">
|
return (
|
||||||
<div className="App-header">
|
<div className="App">
|
||||||
<img src={logo} className="App-logo" alt="logo" />
|
<div className="App-header">
|
||||||
<h2>Welcome to React</h2>
|
<img src={logo} className="App-logo" alt="logo" />
|
||||||
|
<h2>Welcome to React</h2>
|
||||||
|
</div>
|
||||||
|
<p className="App-intro">
|
||||||
|
To get started, edit <code>src/App.js</code> and save to reload.
|
||||||
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<p className="App-intro">
|
);
|
||||||
To get started, edit <code>src/App.js</code> and save to reload.
|
}
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default App;
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
import './index.css';
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { render } from 'react-dom';
|
import { render } from 'react-dom';
|
||||||
import App from './App';
|
import App from './App';
|
||||||
|
import './index.css';
|
||||||
|
|
||||||
const rootEl = document.createElement('div');
|
const rootEl = document.getElementById('root');
|
||||||
document.body.appendChild(rootEl);
|
|
||||||
render(<App />, rootEl);
|
render(<App />, rootEl);
|
||||||
|
|||||||
Reference in New Issue
Block a user