fix: moved some things outside of the OnboardContainer

this prevents refreshing of the entire styled component on render
pull/3056/head
William Grant 12 months ago
parent 94bd2ba0e9
commit 7b221febc1

@ -2,6 +2,16 @@ import { motion } from 'framer-motion';
import { ReactNode } from 'react';
import styled from 'styled-components';
const OnboardContainerInner = styled(motion.div)`
width: 100%;
`;
const fadeSlideVariants = {
initial: { opacity: 0 },
animate: { opacity: 1 },
exit: { opacity: 0 },
};
type OnboardContainerProps = {
animate?: boolean;
children: ReactNode;
@ -10,15 +20,6 @@ type OnboardContainerProps = {
export const OnboardContainer = (props: OnboardContainerProps) => {
const { animate = false, children, key } = props;
const OnboardContainerInner = styled(motion.div)`
width: 100%;
`;
const fadeSlideVariants = {
initial: { opacity: 0 },
animate: { opacity: 1 },
exit: { opacity: 0 },
};
return (
<OnboardContainerInner

Loading…
Cancel
Save