【发布时间】:2018-04-04 20:33:58
【问题描述】:
import React, { Component } from 'react';
import { Animated } from 'react-native';
import PropTypes from 'prop-types';
class Fade extends React.Component {
Fade.propTypes = {
visible:PropTypes.bool,
style:PropTypes.object,
children:PropTypes.any
};
render() {
const { visible, style, children, ...rest } = this.props;
const combinedStyle = [containerStyle, style];
return (
<Animated.View style={this.state.visible ? combinedStyle : containerStyle} {...rest}>
{this.state.visible ? children : null}
</Animated.View>
);
}
}
我收到以下错误:
提供给Fade 的number 类型的无效道具style,应为object
提供给Fade 的number 类型的无效道具style,应为object
【问题讨论】:
-
能否请您包含您持有此组件的父类的代码
标签: reactjs react-native eslint