mirror of
https://github.com/zhigang1992/create-react-app.git
synced 2026-03-29 22:38:26 +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"
|
||||
},
|
||||
"scripts": {
|
||||
"start": "node scripts/start.js",
|
||||
"build": "node scripts/build.js",
|
||||
"start": "node scripts/start.js --debug-template",
|
||||
"build": "node scripts/build.js --debug-template",
|
||||
"create-react-app": "node global-cli/index.js --scripts-version \"$PWD/`npm pack`\""
|
||||
},
|
||||
"files": [
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
<title>React App</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="root"></div>
|
||||
<!--
|
||||
This HTML file is a template.
|
||||
If you open it directly in the browser, you will see an empty page.
|
||||
|
||||
@@ -1,17 +1,21 @@
|
||||
import './App.css';
|
||||
import React from 'react';
|
||||
import React, { Component } from 'react';
|
||||
import logo from './logo.svg';
|
||||
import './App.css';
|
||||
|
||||
export default function App() {
|
||||
return (
|
||||
<div className="App">
|
||||
<div className="App-header">
|
||||
<img src={logo} className="App-logo" alt="logo" />
|
||||
<h2>Welcome to React</h2>
|
||||
class App extends Component {
|
||||
render() {
|
||||
return (
|
||||
<div className="App">
|
||||
<div className="App-header">
|
||||
<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>
|
||||
<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 { render } from 'react-dom';
|
||||
import App from './App';
|
||||
import './index.css';
|
||||
|
||||
const rootEl = document.createElement('div');
|
||||
document.body.appendChild(rootEl);
|
||||
const rootEl = document.getElementById('root');
|
||||
render(<App />, rootEl);
|
||||
|
||||
Reference in New Issue
Block a user