Commit 559af245 by G

short fix to avoid the animation to replay everytime a state value change in a parent component

parent 23c5cdbb
...@@ -6,13 +6,13 @@ import Box from "./bases/Box"; ...@@ -6,13 +6,13 @@ import Box from "./bases/Box";
type Props = { children: React.ReactNode }; type Props = { children: React.ReactNode };
const ContainerBorderTopCurved = ({ children }: Props) => { const ContainerBorderTopCurved = ({ children }: Props) => {
const animated = new Animated.Value(0); const animated = new Animated.Value(0);
// biome-ignore lint/correctness/useExhaustiveDependencies: <we do not want animation to replay everytime this component rerender>
useEffect(() => { useEffect(() => {
Animated.spring(animated, { Animated.spring(animated, {
toValue: 1, toValue: 1,
useNativeDriver: true, useNativeDriver: true,
}).start(); }).start();
}, [animated]); }, []);
return ( return (
<Animated.View <Animated.View
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment