Answers for "Property 'FlatList' does not exist on type 'typeof Animated'"

0

Property 'FlatList' does not exist on type 'typeof Animated'

// to use animated flatlist use this syntax
import {FlatList} from 'react-native';
import Animated, {
  withSpring,
  useAnimatedStyle,
  useSharedValue,
  useAnimatedGestureHandler,
  withDecay,
  useAnimatedScrollHandler,
} from 'react-native-reanimated';

const AnimatedFlatList = Animated.createAnimatedComponent(FlatList);

const translateY = useSharedValue(0);

const scrollHandler = useAnimatedScrollHandler((event) => {
        console.log(translateY);
        translateY.value = event.contentOffset.y;
      });


<AnimatedFlatList
  data={DATA}
  onScroll={scrollHandler}
  ListHeaderComponent={FlatListHeader}
  renderItem={RenderIteam}
  scrollEventThrottle={16} // <-- Use 1 here to make sure no events are ever missed

  contentContainerStyle={{
                         paddingTop: 60,
                         paddingHorizontal: 25,
                         paddingBottom: 60,
                         width: Screen.width,
                        }}
  />
Posted by: Guest on August-25-2021

Code answers related to "Property 'FlatList' does not exist on type 'typeof Animated'"

Code answers related to "Javascript"

Browse Popular Code Answers by Language