amis-rpc-design/node_modules/@react-navigation/elements/src/Background.tsx

20 lines
516 B
TypeScript
Raw Normal View History

2023-10-07 19:42:30 +08:00
import { useTheme } from '@react-navigation/native';
import * as React from 'react';
import { Animated, StyleProp, ViewProps, ViewStyle } from 'react-native';
type Props = Omit<ViewProps, 'style'> & {
style?: Animated.WithAnimatedValue<StyleProp<ViewStyle>>;
children: React.ReactNode;
};
export function Background({ style, ...rest }: Props) {
const { colors } = useTheme();
return (
<Animated.View
{...rest}
style={[{ flex: 1, backgroundColor: colors.background }, style]}
/>
);
}