Skip to content

Commit a3d43c7

Browse files
authored
reanimated changes (keybase#26193)
1 parent 9874ff8 commit a3d43c7

3 files changed

Lines changed: 9 additions & 8 deletions

File tree

‎shared/common-adapters/box.native.tsx‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,12 +109,15 @@ export const Box2Div = () => {
109109
throw new Error('Wrong platform')
110110
}
111111

112-
export const Box2View = React.forwardRef<View, Box2Props>(function Box2Animated(p, ref) {
112+
export const Box2View = React.forwardRef<View, Box2Props>(function Box2View(p, ref) {
113113
const props = useBox2Shared(p)
114114
return <View {...props} ref={ref} />
115115
})
116116

117-
export const Box2Animated = Reanimated.createAnimatedComponent(Box2View)
117+
export const Box2Animated = React.forwardRef<View, Box2Props>(function Box2Animated(p, ref) {
118+
const props = useBox2Shared(p)
119+
return <Reanimated.View {...props} ref={ref} />
120+
})
118121

119122
export const Box2Measure = React.forwardRef<MeasureRef, Box2Props>(function Box2(p, _ref) {
120123
React.useImperativeHandle(

‎shared/common-adapters/list.native.tsx‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,10 @@ import * as React from 'react'
22
import {FlatList, View} from 'react-native'
33
import * as Styles from '@/styles'
44
import type {Props} from './list'
5-
import {createAnimatedComponent} from './reanimated'
5+
import ReAnimated from './reanimated'
66
import noop from 'lodash/noop'
77

8-
// eslint-disable-next-line deprecation/deprecation
9-
const AnimatedFlatList = createAnimatedComponent(FlatList)
8+
const AnimatedFlatList = ReAnimated.FlatList
109

1110
class List<Item> extends React.PureComponent<Props<Item>> {
1211
static defaultProps = {

‎shared/common-adapters/list2.native.tsx‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,11 @@ import * as React from 'react'
22
import {FlatList, View} from 'react-native'
33
import * as Styles from '@/styles'
44
import {smallHeight, largeHeight} from './list-item2'
5-
import {createAnimatedComponent} from './reanimated'
5+
import ReAnimated from './reanimated'
66
import type {Props} from './list2'
77
import noop from 'lodash/noop'
88

9-
// eslint-disable-next-line deprecation/deprecation
10-
const AnimatedFlatList = createAnimatedComponent(FlatList)
9+
const AnimatedFlatList = ReAnimated.FlatList
1110

1211
class List2<T> extends React.PureComponent<Props<T>> {
1312
static defaultProps = {

0 commit comments

Comments
 (0)