Are there any flow types definition for react-native styles?

前端 未结 2 1042
慢半拍i
慢半拍i 2021-02-19 22:37

I\'m making a react native component and using Flow to define the property types like this:

type Props = {
    text: string,
    textStyle: object
}
2条回答
  •  野的像风
    2021-02-19 23:06

    Update

    StyleObj is no longer part of StyleSheetTypes.

    Now import:

    {LayoutStyle, TransformStyle, ShadowStyle, ViewStyle, TextStyle, ImageStyle, DangerouslyImpreciseStyle} from 'react-native/Libraries/StyleSheet/StyleSheetTypes';

    In your case, you should:

    import { TextStyle } from 'react-native/Libraries/StyleSheet/StyleSheetTypes';

提交回复
热议问题