AnimatedBox predefined component #230
hamdij0maa
started this conversation in
Ideas
Replies: 1 comment
-
It would be super if this worked, however it all goes wonky with hot reloading. type BoxProps = ComponentProps<typeof Box>;
type AnimatedViewProps = AnimatedProps<ViewProps & {children?: ReactNode}>;
type Props = BoxProps & AnimatedViewProps;
export const AnimatedBox = createBox<Theme, Props>(Animated.View); I've ended up going with something like this type BoxProps = ComponentProps<typeof Box>;
type AnimatedViewProps = AnimatedProps<ViewProps & {children?: ReactNode}>;
type Props = BoxProps & AnimatedViewProps;
export const AnimatedBox = createRestyleComponent<
BoxProps & Omit<Props, keyof BoxProps>,
Theme
>(
boxRestyleFunctions as RestyleFunctionContainer<BoxProps, Theme>[],
Animated.View,
); |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Can we add this :
import {Theme} from './theme';
const Box = createBox();
export default Box;
type AnimatedViewProps = Animated.AnimateProps<
ViewProps & {children?: ReactNode}
type Props = BoxProps & AnimatedViewProps;
export const AnimatedBox = createRestyleComponent<Props, Theme>(
[spacing, backgroundColor, spacing, border, shadow],
Animated.View,
);
``
Beta Was this translation helpful? Give feedback.
All reactions