React-Native:type props

一、TypeScript入门
https://www.jianshu.com/p/c4e639296b98

type ItemProps = {
  title: String,
  desc: String,
  backgroundColor: String,
  borderColor: String,
  img: any,
  onPress: Function,
}

const Item = ({ backgroundColor, borderColor, img, title, desc, onPress }:ItemProps) => (
   onPress()} style={rowStyles.itemContainer}>
    
      
        {title}
        {desc}
      
      
    
  
)

你可能感兴趣的:(React-Native:type props)