import React from 'react';
export default App;
import App from './APP.jsx';
class App extends React.Component {}
getInitialState() { return {liked: false}; }
constructor(props) { super(props); this.state = { liked: false } }
class LinkButton extends React.Component { getDefaultProps() { return { name: 'Runoob' }; } }
LinkButton.defaultProps = {name: 'Runoob'}
propTypes: { title: React.PropTypes.string.isRequired, },
LinkButton.propTypes = {title: React.PropTypes.string.required}
<p onClick={this.handelClick}>點我切換狀態</p>
<p onClick={e=>this.handelClick(e)}>點我切換狀態</p>