I have a styled component:
import styled, { keyframes } from 'styled-components';
const slideToCorner = keyframes`
from {
right: 0;
top: 0;
}
to {
right: 300px;
top: 50px;
}
`;
const SlideToCorner = styled.div`
position: relative;
right: 0;
top: 0;
${props => props.slide && `animation: ${slideToCorner} 0.5s linear;`}
transition: all 1s linear;
`;
export default SlideToCorner;
This is how it's being used:
<SlideToCorner slide={matchingStatus === MATCHING_STATES.CONFIRMING}>
<TargetBox>
<LocalVideo />
</TargetBox>
</SlideToCorner>
However, when it animates it keeps resetting back to it's original position halfway through the animation:
I can confirm that it is not the matchingStatus === MATCHING_STATES.CONFIRMING that is causing it.
