You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/template/src/App.js is now using React Component Class, but this component is stateless.
So I think <App /> should be Stateless Functional Component.
I'm not good at English, here is a code example of my idea.
ASIS:
classAppextendsComponent{render(){return(<divclassName="App"><divclassName="App-header"><imgsrc={logo}className="App-logo"alt="logo"/><h2>Welcome to React</h2></div><pclassName="App-intro">
To get started, edit <code>src/App.js</code> and save to reload.
</p></div>);}}
TOBE:
constApp=()=>(<divclassName="App"><divclassName="App-header"><imgsrc={logo}className="App-logo"alt="logo"/><h2>Welcome to React</h2></div><pclassName="App-intro">
To get started, edit <code>src/App.js</code> and save to reload.
</p></div>);
If you agree this proposal, I will create a pull request!
The text was updated successfully, but these errors were encountered:
Hi, we think most beginners would be confused seeing SFC there because we still don't use them as much in the documentation. Additionally they would not be sure how to add state or lifecycle methods. Moreover we would miss an opportunity to show that this project supports ES classes out of the box, so they would probably use createClass() syntax. Combined, these are the reasons we don't use SFC in this example.
/template/src/App.js
is now using React Component Class, but this component is stateless.So I think
<App />
should be Stateless Functional Component.I'm not good at English, here is a code example of my idea.
ASIS:
TOBE:
If you agree this proposal, I will create a pull request!
The text was updated successfully, but these errors were encountered: