react-native prop type for text style

前端 未结 2 1753
暖寄归人
暖寄归人 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
    };
    
    0 讨论(0)
  • 2021-02-05 17:47

    For anybody trying to achieve this seems like View.propTypes.style is deprecated while Text.propTypes.style is not.

    0 讨论(0)
提交回复
热议问题