【发布时间】:2019-03-26 10:23:36
【问题描述】:
我正在尝试使此代码正常工作
import { StyleSheet } from 'react-native';
const Container = styled.View`
justify-content: center;
align-items: center;
${StyleSheet.absoluteFillObject};
`;
不幸的是,打字稿抱怨以下错误:
[ts]
Argument of type 'AbsoluteFillStyle' is not assignable to parameter of type 'Interpolation<ThemedStyledProps<ViewProps & ContainerProps, any>>'.
Type 'AbsoluteFillStyle' is not assignable to type 'ReadonlyArray<string | number | false | Styles | StyledComponentClass<any, any, any> | InterpolationFunction<ThemedStyledProps<ViewProps & ContainerProps, any>> | ReadonlyArray<FlattenInterpolation<ThemedStyledProps<ViewProps & ContainerProps, any>>> | null | undefined>'.
Property 'length' is missing in type 'AbsoluteFillStyle'.
如有任何帮助,请提前致谢。
【问题讨论】:
标签: typescript react-native styled-components