react-native prop type for text style

前端 未结 2 1751
暖寄归人
暖寄归人 2021-02-05 17:32

i have component with a simple structure and a somewhere inside the tree for which i want to pass in a style. Which works perfectly but for the proptyp

2条回答
  •  谎友^
    谎友^ (楼主)
    2021-02-05 17:45

    As the passed style prop is for the Text node, use Text.propTypes.style as shown below...

    Component.propTypes = {
        style: Text.propTypes.style
    };
    

提交回复
热议问题