我現在有一個陣營組成部分......下面的代碼:陣營組件變化從一種類型到另
import React, { PropTypes } from 'react';
export default class Message extends React.Component {
constructor(props) {
super(props);
}
render() {
const { type } = this.props;
if (type === 'success') {
return (<div>{this.props.msg}</div>);
}
}
}
我需要將其更改爲這種類型的組件:
const Message = props => (
//Stuff here
);
export default Message
我怎樣才能做到這一點?
更換'const的消息...'和'常量留言= props => props.type ==='成功'?