问下这个static什么意思?

class ErrorHandle extends Component {

    static propTypes = {

        infoText: PropTypes.string,

        onPress: PropTypes.func,

        buttonText: PropTypes.string

    };



    static defaultProps = {

        infoText: '网络出错啦, 请点击按钮重新加载',

        buttonText: '重新获取'

    };



    render() {

        return (

            <View style={styles.container}>

                <Text style={styles.infoText}>

                    { this.props.infoText }

                </Text>

                <TouchableOpacity onPress={this.props.onPress}>

                    <View style={styles.button}>

                        <Text style={styles.buttonText}>

                            { this.props.buttonText }

                        </Text>

                    </View>

                </TouchableOpacity>

            </View>

        )

    }

}


神不在的星期二
浏览 493回答 1
1回答
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

JavaScript