This commit is contained in:
Dan Abramov
2023-11-10 15:58:41 +00:00
parent 2cc26cf805
commit 7e4fa95b48
+1 -2
View File
@@ -1,6 +1,5 @@
import * as React from 'react' import * as React from 'react'
import {View} from 'react-native' import {View} from 'react-native'
import {observer} from 'mobx-react-lite'
import Animated, {useAnimatedScrollHandler} from 'react-native-reanimated' import Animated, {useAnimatedScrollHandler} from 'react-native-reanimated'
export default function App() { export default function App() {
@@ -19,7 +18,7 @@ export default function App() {
return <Child onScroll={handler} /> return <Child onScroll={handler} />
} }
const Child = observer(function ({onScroll}) { const Child = React.memo(function ({onScroll}) {
return ( return (
<View style={{flex: 1, flexDirection: 'row'}}> <View style={{flex: 1, flexDirection: 'row'}}>
<Animated.FlatList <Animated.FlatList