Skip to content

Commit

Permalink
chore: Update animated example
Browse files Browse the repository at this point in the history
  • Loading branch information
retyui committed Nov 28, 2024
1 parent 39f37d7 commit 0a06ebf
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions packages/react-native-web-examples/pages/animated/index.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
import React, { useRef } from 'react';
import { Animated, Pressable, StyleSheet, Text, View } from 'react-native';
import React from 'react';
import { Animated, Pressable, StyleSheet, Text, View, useAnimatedValue } from 'react-native';
import Example from '../../shared/example';

export default function AnimatedPage() {
const anim = useRef(new Animated.Value(0));
const anim = useAnimatedValue(0);

const animateBox = () => {
Animated.timing(anim.current, {
Animated.timing(anim, {
toValue: 1,
duration: 1000,
useNativeDriver: false
}).start();
};

const transform = anim.current.interpolate({
const transform = anim.interpolate({
inputRange: [0, 1],
outputRange: ['rotate(0deg)', 'rotate(45deg)']
});
Expand Down

0 comments on commit 0a06ebf

Please sign in to comment.