Skip to content

Commit 95ded5e

Browse files
authored
Upgrade react-native to 0.71.12 (#2816)
* Upgrade react-native to 0.71.12 * Oops * Change types, reanimated version and move to yarn
1 parent b997db4 commit 95ded5e

File tree

20 files changed

+9322
-17
lines changed

20 files changed

+9322
-17
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ yarn-error.log
6464
# UILib
6565
dist
6666
dist-ts
67-
yarn.lock
6867
package-lock.json
6968
docs/**/*.md
7069

Gemfile

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
source 'https://rubygems.org'
22

33
# You may use http://rbenv.org/ or https://rvm.io/ to install and use this version
4-
ruby File.read(File.join(__dir__, '.ruby-version')).strip
5-
6-
gem 'cocoapods', '~> 1.11', '>= 1.11.3'
4+
ruby '>= 2.6.10'
5+
gem 'cocoapods', '>= 1.11.3'

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@
7676
"@types/jest": "^29.2.1",
7777
"@types/lodash": "^4.0.0",
7878
"@types/prop-types": "^15.5.3",
79-
"@types/react": "^18.0.24",
80-
"@types/react-native": "0.68.5",
79+
"@types/react": "^18.2.15",
80+
"@types/react-native": "0.71.2",
8181
"@types/tinycolor2": "^1.4.2",
8282
"@types/url-parse": "^1.4.3",
8383
"@typescript-eslint/eslint-plugin": "^5.3.1",
@@ -96,7 +96,7 @@
9696
"gh-pages": "^1.1.0",
9797
"jest": "^29.2.1",
9898
"light-date": "^1.2.0",
99-
"metro-react-native-babel-preset": "0.73.7",
99+
"metro-react-native-babel-preset": "0.73.10",
100100
"mocha": "^5.0.0",
101101
"moment": "^2.24.0",
102102
"object-hash": "^3.0.0",
@@ -106,14 +106,14 @@
106106
"react": "18.2.0",
107107
"react-autobind": "^1.0.6",
108108
"react-dom": "^18.2.0",
109-
"react-native": "0.71.2",
109+
"react-native": "0.71.12",
110110
"react-native-fs": "^2.20.0",
111111
"react-native-gesture-handler": "2.9.0",
112112
"react-native-haptic-feedback": "^1.11.0",
113113
"react-native-linear-gradient": "2.6.2",
114114
"react-native-mmkv": "2.6.1",
115115
"react-native-navigation": "7.32.1",
116-
"react-native-reanimated": "3.1.0",
116+
"react-native-reanimated": "3.4.0",
117117
"react-native-shimmer-placeholder": "^2.0.6",
118118
"react-native-svg": "^13.7.0",
119119
"react-native-svg-transformer": "^0.14.3",

src/components/gridListItem/index.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,11 +189,13 @@ class GridListItem extends Component<GridListItemProps> {
189189
const TextContainer = overlayText ? View : React.Fragment;
190190
const textContainerStyle = overlayText ? {style: [styles.overlayText, overlayTextContainerStyle]} : null;
191191
const imageBorderRadius = imageProps?.borderRadius;
192+
// @ts-ignore hitSlop issues
193+
const {hitSlop, ...otherContainerProps} = containerProps; // eslint-disable-line
192194

193195
return (
194196
<Container
195197
style={[styles.container, alignToStart && styles.containerAlignedToStart, {width}, containerStyle]}
196-
{...containerProps}
198+
{...otherContainerProps}
197199
onPress={hasPress ? this.onItemPress : undefined}
198200
accessible={renderCustomItem ? true : undefined}
199201
{...Modifiers.extractAccessibilityProps(this.props)}

src/components/listItem/index.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,14 @@ class ListItem extends Component<ListItemProps, ListItemState> {
4949

5050
renderViewContainer = () => {
5151
const {pressed} = this.state;
52-
const {containerStyle, style, underlayColor, ...others} = this.props;
52+
const {
53+
containerStyle,
54+
style,
55+
underlayColor,
56+
// eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars
57+
hitSlop,
58+
...others
59+
} = this.props;
5360
const pressedStyle = {backgroundColor: underlayColor};
5461
return (
5562
<View style={[this.styles.container, containerStyle]} {...others}>

src/components/marquee/index.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ function Marquee(props: MarqueeProps) {
7676
}
7777
}, [viewLayout, textLayout]);
7878

79+
// @ts-expect-error should be fixed in version 3.5 (https://github.com/software-mansion/react-native-reanimated/pull/4881)
7980
const translateStyle = useAnimatedStyle(() => {
8081
if (offset.value) {
8182
return {
@@ -89,6 +90,7 @@ function Marquee(props: MarqueeProps) {
8990

9091
return (
9192
<View style={[styles.container, containerStyle]} onLayout={onLayoutView}>
93+
{/* @ts-expect-error should be fixed in version 3.5 (https://github.com/software-mansion/react-native-reanimated/pull/4881) */}
9294
<View reanimated style={[translateStyle]}>
9395
<Text style={[styles.text, labelStyle]} onLayout={onLayoutText}>
9496
{label}

src/components/segmentedControl/index.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import Reanimated, {
77
useAnimatedStyle,
88
useSharedValue,
99
withTiming,
10-
WithTimingConfig,
1110
runOnJS
1211
} from 'react-native-reanimated';
1312
import {Colors, BorderRadiuses, Spacings} from '../../style';
@@ -16,7 +15,7 @@ import View from '../view';
1615
import Segment, {SegmentedControlItemProps} from './segment';
1716

1817
const BORDER_WIDTH = 1;
19-
const TIMING_CONFIG: WithTimingConfig = {
18+
const TIMING_CONFIG = {
2019
duration: 300,
2120
easing: Easing.bezier(0.33, 1, 0.68, 1)
2221
};

src/components/sortableGridList/SortableItem.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ function SortableItem(props: PropsWithChildren<SortableItemProps & ReturnType<ty
156156
}
157157
});
158158

159+
// @ts-expect-error should be fixed in version 3.5 (https://github.com/software-mansion/react-native-reanimated/pull/4881)
159160
const animatedStyle = useAnimatedStyle(() => {
160161
const scale = withSpring(isDragging.value ? 1.1 : 1);
161162
const zIndex = isDragging.value ? 100 : withTiming(0, animationConfig);
@@ -167,6 +168,7 @@ function SortableItem(props: PropsWithChildren<SortableItemProps & ReturnType<ty
167168
});
168169

169170
return (
171+
// @ts-expect-error should be fixed in version 3.5 (https://github.com/software-mansion/react-native-reanimated/pull/4881)
170172
<View reanimated style={[style, animatedStyle]} onLayout={onLayout}>
171173
<GestureDetector gesture={dragOnLongPressGesture}>
172174
<View>{props.children}</View>

src/components/sortableGridList/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ function SortableGridList<T = any>(props: SortableGridListProps<T>) {
6363
return (
6464
<GestureHandlerRootView>
6565
<ScrollView contentContainerStyle={[styles.listContent, listContentStyle]}>
66-
{data?.map((item, index) => _renderItem({item, index} as ListRenderItemInfo<ItemProps<T>>))}
66+
{_.map(data, (item, index) => _renderItem({item, index} as ListRenderItemInfo<ItemProps<T>>))}
6767
</ScrollView>
6868
</GestureHandlerRootView>
6969
);

src/components/sortableList/index.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ function generateItemsOrder<ItemT extends SortableListItemProps>(data: SortableL
1717
}
1818

1919
function generateLockedIds<ItemT extends SortableListItemProps>(data: SortableListProps<ItemT>['data']) {
20+
// @ts-expect-error - not worth further time investment IMO, maybe it'll work some day
2021
return reduce(filter(data, item => item.locked),
22+
// @ts-expect-error - not worth further time investment IMO, maybe it'll work some day
2123
(item, cur) => ({...item, [(cur as ItemT).id]: true}),
2224
{});
2325
}

src/components/tabController/PageCarousel.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ function PageCarousel(props: ScrollViewProps) {
104104
<Reanimated.ScrollView
105105
{...others}
106106
style={_style}
107+
// @ts-expect-error should be fixed in version 3.5 (https://github.com/software-mansion/react-native-reanimated/pull/4881)
107108
ref={carousel}
108109
horizontal
109110
pagingEnabled

src/components/tabController/TabBarItem.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ export interface TabControllerItemProps {
103103
interface Props extends TabControllerItemProps {
104104
index: number;
105105
targetPage: any; // TODO: typescript?
106+
// @ts-expect-error should be fixed in version 3.5 (https://github.com/software-mansion/react-native-reanimated/pull/4881)
106107
currentPage: Reanimated.Adaptable<number>;
107108
onLayout?: (event: LayoutChangeEvent, index: number) => void;
108109
}

src/incubator/Calendar/Header.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,11 @@ const Header = (props: HeaderProps) => {
5858
return <Text style={styles.title}>{title}</Text>;
5959
}
6060
return (
61-
// @ts-expect-error
6261
<AnimatedTextInput
6362
value={getTitle(selectedDate.value)} // setting initial value
6463
{...{animatedProps}}
6564
editable={false}
65+
// @ts-expect-error should be fixed in version 3.5 (https://github.com/software-mansion/react-native-reanimated/pull/4881)
6666
style={styles.title}
6767
/>);
6868
};

src/incubator/Calendar/TodayButton.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ const TodayButton = (props: TodayButtonProps) => {
1616
const {containerStyle, buttonProps} = props;
1717
const {selectedDate, setDate} = useContext(CalendarContext);
1818

19+
// @ts-expect-error should be fixed in version 3.5 (https://github.com/software-mansion/react-native-reanimated/pull/4881)
1920
const animatedStyle = useAnimatedStyle(() => {
2021
return {
2122
transform: [
@@ -39,6 +40,7 @@ const TodayButton = (props: TodayButtonProps) => {
3940
[buttonProps]);
4041

4142
return (
43+
// @ts-expect-error should be fixed in version 3.5 (https://github.com/software-mansion/react-native-reanimated/pull/4881)
4244
<View reanimated style={[styles.container, containerStyle, animatedStyle]}>
4345
<Button
4446
outline

src/incubator/Dialog/index.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ const Dialog = (props: DialogProps, ref: ForwardedRef<DialogImperativeMethods>)
124124
// eslint-disable-next-line react-hooks/exhaustive-deps
125125
}, []);
126126

127+
// @ts-expect-error should be fixed in version 3.5 (https://github.com/software-mansion/react-native-reanimated/pull/4881)
127128
const animatedStyle = useAnimatedStyle(() => {
128129
if (isVertical) {
129130
return {
@@ -199,6 +200,7 @@ const Dialog = (props: DialogProps, ref: ForwardedRef<DialogImperativeMethods>)
199200

200201
const renderDialog = () => (
201202
<GestureDetector gesture={panGesture}>
203+
{/* @ts-expect-error should be fixed in version 3.5 (https://github.com/software-mansion/react-native-reanimated/pull/4881) */}
202204
<View {...containerProps} reanimated style={style} onLayout={onLayout} ref={setRef} testID={testID}>
203205
{headerProps && <DialogHeader {...headerProps}/>}
204206
{children}

src/incubator/Slider/Thumb.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ const Thumb = (props: ThumbProps) => {
8585
});
8686
gesture.enabled(!disabled);
8787

88+
// @ts-expect-error should be fixed in version 3.5 (https://github.com/software-mansion/react-native-reanimated/pull/4881)
8889
const animatedStyle = useAnimatedStyle(() => {
8990
const customStyle = isPressed.value ? activeStyle?.value : defaultStyle?.value;
9091
return {
@@ -107,6 +108,7 @@ const Thumb = (props: ThumbProps) => {
107108
<GestureDetector gesture={gesture}>
108109
<View
109110
reanimated
111+
// @ts-expect-error should be fixed in version 3.5 (https://github.com/software-mansion/react-native-reanimated/pull/4881)
110112
style={[styles.thumbPosition, styles.thumbShadow, animatedStyle]}
111113
hitSlop={hitSlop}
112114
onLayout={onThumbLayout}

src/incubator/Slider/index.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,7 @@ const Slider = React.memo((props: Props) => {
332332
}
333333
}, []);
334334

335+
// @ts-expect-error should be fixed in version 3.5 (https://github.com/software-mansion/react-native-reanimated/pull/4881)
335336
const trackAnimatedStyles = useAnimatedStyle(() => {
336337
if (useRange) {
337338
return {

src/incubator/TouchableOpacity.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ function TouchableOpacity(props: Props) {
131131
}
132132
});
133133

134+
// @ts-expect-error should be fixed in version 3.5 (https://github.com/software-mansion/react-native-reanimated/pull/4881)
134135
const animatedStyle = useAnimatedStyle(() => {
135136
const activeColor = feedbackColor || backgroundColor;
136137
const opacity = interpolate(isActive.value, [0, 1], [1, activeOpacity]);
@@ -149,13 +150,11 @@ function TouchableOpacity(props: Props) {
149150

150151
return (
151152
<TapGestureHandler
152-
// @ts-expect-error
153153
onGestureEvent={tapGestureHandler}
154154
shouldCancelWhenOutside
155155
enabled={!disabled}
156156
>
157157
<Reanimated.View>
158-
{/* @ts-expect-error */}
159158
<Container onGestureEvent={longPressGestureHandler} shouldCancelWhenOutside>
160159
<Reanimated.View
161160
{...others}

src/incubator/panView/index.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ const PanView = (props: Props) => {
6060
hiddenLocation
6161
});
6262

63+
// @ts-expect-error should be fixed in version 3.5 (https://github.com/software-mansion/react-native-reanimated/pull/4881)
6364
const animatedStyle = useAnimatedStyle(() => {
6465
return {
6566
transform: [{translateX: translation.x.value}, {translateY: translation.y.value}]
@@ -69,6 +70,7 @@ const PanView = (props: Props) => {
6970
return (
7071
<View ref={setRef} style={containerStyle} onLayout={onLayout}>
7172
<PanGestureHandler onGestureEvent={isEmpty(directions) ? undefined : panGestureEvent}>
73+
{/* @ts-expect-error should be fixed in version 3.5 (https://github.com/software-mansion/react-native-reanimated/pull/4881) */}
7274
<View reanimated style={animatedStyle}>
7375
<View {...others}>{children}</View>
7476
</View>

0 commit comments

Comments
 (0)