添加信息保存接口:server/user.js
引入bossinfo组件页面:src/index.js
头像子组件:src/component/avatar-selector
boss完善信息页面:src/container/bossinfo
引入geniusinfo组件页面:src/index.js
牛人完善信息页面:src/container/geniusinfo
https://react.docschina.org/docs/typechecking-with-proptypes.html
安装prop-types
cnpm install prop-types --save
src/component/avatar-selector/index.js
import PropTypes from "prop-types";
class AvatarSelector extends React.Component {
static propTypes = {
selectAvatar: PropTypes.func.isRequired // selectAvatar是一个function,且必传
};
}
http://localhost:3000/bossinfo
http://localhost:3000/geniusinfo