标签:super markdown ext react struct defaults tor xtend end
class MyComponent extends React.Component {
    constructor(props){
        super(props);
        this.state={
            name:props.name
        };
    }
}
MyComponent.defaultProps={
    name:‘default name‘
};
const MyFunctionalComponent=(props)=>{
    return (
        <div>
            <p>{props.name}</p>
        </div>
    );
}
MyFunctionalComponent.defaultProps={
    name:‘default name‘
};
标签:super markdown ext react struct defaults tor xtend end
原文地址:http://www.cnblogs.com/Saints/p/7927870.html