自定义navigationBar一直报warning
来源:
danceingsoft
2017-03-19
自定义navigationBar一直报warning,invalid props.style.key 'barStyle'
写回答
1回答
-
CrazyCodeBoy
2017-03-20
barStyle是不是定义错位置了呢?
可参考代码:
const StatusBarShape = { barStyle: PropTypes.oneOf(['light-content', 'default',]), hidden: PropTypes.bool, backgroundColor: PropTypes.string, }; export default class NavigationBar extends Component { static propTypes = { style: View.propTypes.style, title: PropTypes.string, titleView: PropTypes.element, titleLayoutStyle:View.propTypes.style, hide: PropTypes.bool, statusBar: PropTypes.shape(StatusBarShape), rightButton: PropTypes.element, leftButton: PropTypes.element, } static defaultProps = { statusBar: { barStyle: 'light-content', hidden: false, }, } ...
00
相似问题