React在1,2和3之间是否存在性能差异?
1
class App extends Component {
renderHeader = () => <h1>Hello</h1>;
render() {
return <div>
{this.renderHeader()}
</div>;
}
}
2
class App extends Component {
render() {
return <div>
<h1>Hello</h1>
</div>;
}
}
3
class App extends Component {
render() {
return <div>
<Header />
</div>;
}
}
class Header extends Component {
render() {
return <h1>Hello</h1>;
}
}