facebook / prop-types

Runtime type checking for React props and similar objects
MIT License
4.48k stars 356 forks source link

TypeError: undefined is not an object (evaluating '_reactNative.TextPropTypes.style') #352

Closed utkarshchowdhary closed 3 years ago

utkarshchowdhary commented 3 years ago

Referencing TextPropTypes.style for setting Text style prop for a component throws type error.

ljharb commented 3 years ago

I'm not sure how this is related to the prop-types package.

utkarshchowdhary commented 3 years ago

I don't know where the issue lies , i'm using prop-types package for documenting props for a component where i wanna pass styles specific to TEXT Component as a prop but specifying TextPropTypes.style for the style prop inside static propTypes object doesn't work it throws TypeError. It's working for ViewPropTypes.style though.

ljharb commented 3 years ago

Right but that’s about react or your own code - TextPropTypes and ViewPropTypes don’t come from this package,

utkarshchowdhary commented 3 years ago

Oh Okay, if so can u demonstrate a working example of how would i pass a style object as a prop specific to TEXT Component and utilize prop-types package to validate that ?

ljharb commented 3 years ago

This package exports specific validators. If you’re not using one, this repo isn’t the place to get help, I’m afraid.

utkarshchowdhary commented 3 years ago

ah, thanks anyway.