[RN]component 模板

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/tomlucky1024/article/details/83994516
import React, { Component } from "react"
import { View, Text } from "react-native"
import PropTypes from "prop-types"
class  ${NAME} extends Component {
  constructor(props) {
    super(props)
    this.state = {}
  }
  static propTypes = {
    //define the prop types
    // tempStr: PropTypes.string,
    // tempMethod: PropTypes.object
    //  onClickRightIcon: PropTypes.func.isRequired
  }
  static defaultProps = {
    //default values for props
  }
  render() {
    const { ...props } = this.props
    return (
      <View>
        <Text>hello word</Text>
      </View>
    )
  }
}
const styles = StyleSheet.create({
  xxx: {}
})
export default ${NAME}

猜你喜欢

转载自blog.csdn.net/tomlucky1024/article/details/83994516
RN
今日推荐