Skip to content

Commit 5dcb9a0

Browse files
committed
Merge branch 'next' into @akwasniewski/fix-native-attach-detach
2 parents 2f0d5ad + ce462b4 commit 5dcb9a0

34 files changed

+146
-124
lines changed

apps/common-app/tsconfig.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"compilerOptions": {
44
"noEmit": true,
55
"baseUrl": ".",
6+
"noImplicitOverride": false,
67
"paths": {
78
"@/*": ["./*"],
89
"react-native-gesture-handler": [

packages/react-native-gesture-handler/src/components/DrawerLayout.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,10 @@ export default class DrawerLayout extends Component<
263263
this.updateAnimatedEvent(props, this.state);
264264
}
265265

266-
shouldComponentUpdate(props: DrawerLayoutProps, state: DrawerLayoutState) {
266+
override shouldComponentUpdate(
267+
props: DrawerLayoutProps,
268+
state: DrawerLayoutState
269+
) {
267270
if (
268271
this.props.drawerPosition !== props.drawerPosition ||
269272
this.props.drawerWidth !== props.drawerWidth ||
@@ -719,7 +722,7 @@ export default class DrawerLayout extends Component<
719722
this.props.onGestureRef?.(ref);
720723
};
721724

722-
render() {
725+
override render() {
723726
const { drawerPosition, drawerLockMode, edgeWidth, minSwipeDistance } =
724727
this.props;
725728

packages/react-native-gesture-handler/src/components/GestureButtons.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ class InnerBaseButton extends React.Component<BaseButtonWithRefProps> {
122122
); // TODO: maybe it is not correct
123123
};
124124

125-
render() {
125+
override render() {
126126
const { rippleColor: unprocessedRippleColor, style, ...rest } = this.props;
127127

128128
if (IS_FABRIC === null) {
@@ -190,7 +190,7 @@ class InnerRectButton extends React.Component<RectButtonWithRefProps> {
190190
this.props.onActiveStateChange?.(active);
191191
};
192192

193-
render() {
193+
override render() {
194194
const { children, style, ...rest } = this.props;
195195

196196
const resolvedStyle = StyleSheet.flatten(style) ?? {};
@@ -247,7 +247,7 @@ class InnerBorderlessButton extends React.Component<BorderlessButtonWithRefProps
247247
this.props.onActiveStateChange?.(active);
248248
};
249249

250-
render() {
250+
override render() {
251251
const { children, style, innerRef, ...rest } = this.props;
252252

253253
return (

packages/react-native-gesture-handler/src/components/Swipeable.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ export default class Swipeable extends Component<
257257
);
258258
}
259259

260-
shouldComponentUpdate(props: SwipeableProps, state: SwipeableState) {
260+
override shouldComponentUpdate(props: SwipeableProps, state: SwipeableState) {
261261
if (
262262
this.props.friction !== props.friction ||
263263
this.props.overshootLeft !== props.overshootLeft ||
@@ -504,7 +504,7 @@ export default class Swipeable extends Component<
504504
this.setState({ rowState: 0 });
505505
};
506506

507-
render() {
507+
override render() {
508508
const { rowState } = this.state;
509509
const {
510510
children,

packages/react-native-gesture-handler/src/components/touchables/GenericTouchable.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ export default class GenericTouchable extends Component<
115115
}
116116
}
117117

118-
componentDidMount() {
118+
override componentDidMount() {
119119
this.reset();
120120
}
121121
// Reset timeout to prevent memory leaks.
@@ -204,7 +204,7 @@ export default class GenericTouchable extends Component<
204204
this.props.onLongPress?.();
205205
};
206206

207-
componentWillUnmount() {
207+
override componentWillUnmount() {
208208
// To prevent memory leaks
209209
this.reset();
210210
}
@@ -225,7 +225,7 @@ export default class GenericTouchable extends Component<
225225
}
226226
}
227227

228-
render() {
228+
override render() {
229229
const hitSlop =
230230
(typeof this.props.hitSlop === 'number'
231231
? {

packages/react-native-gesture-handler/src/components/touchables/TouchableHighlight.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ export default class TouchableHighlight extends Component<
103103
}
104104
};
105105

106-
render() {
106+
override render() {
107107
const { style = {}, ...rest } = this.props;
108108
const { extraUnderlayStyle } = this.state;
109109
return (

packages/react-native-gesture-handler/src/components/touchables/TouchableNativeFeedback.android.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ export default class TouchableNativeFeedback extends Component<TouchableNativeFe
7070
extraProps['foreground'] = this.props.useForeground;
7171
return extraProps;
7272
}
73-
render() {
73+
override render() {
7474
const { style = {}, ...rest } = this.props;
7575
return (
7676
<GenericTouchable

packages/react-native-gesture-handler/src/components/touchables/TouchableOpacity.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ export default class TouchableOpacity extends Component<TouchableOpacityProps> {
5959
}
6060
};
6161

62-
render() {
62+
override render() {
6363
const { style = {}, ...rest } = this.props;
6464
return (
6565
<GenericTouchable

packages/react-native-gesture-handler/src/handlers/ForceTouchGestureHandler.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@ export const forceTouchGestureHandlerProps = [
1717
// implicit `children` prop has been removed in @types/react^18.0.0
1818
class ForceTouchFallback extends React.Component<PropsWithChildren<unknown>> {
1919
static forceTouchAvailable = false;
20-
componentDidMount() {
20+
override componentDidMount() {
2121
console.warn(
2222
tagMessage(
2323
'ForceTouchGestureHandler is not available on this platform. Please use ForceTouchGestureHandler.forceTouchAvailable to conditionally render other components that would provide a fallback behavior specific to your usecase'
2424
)
2525
);
2626
}
27-
render() {
27+
override render() {
2828
return this.props.children;
2929
}
3030
}

packages/react-native-gesture-handler/src/handlers/createHandler.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ export default function createHandler<
184184
HandlerState
185185
> {
186186
static displayName = name;
187-
static contextType = GestureHandlerRootViewContext;
187+
static override contextType = GestureHandlerRootViewContext;
188188

189189
private handlerTag = -1;
190190
private config: Record<string, unknown>;
@@ -208,7 +208,7 @@ export default function createHandler<
208208
}
209209
}
210210

211-
componentDidMount() {
211+
override componentDidMount() {
212212
const props: HandlerProps<U> = this.props;
213213
this.isMountedRef.current = true;
214214

@@ -250,15 +250,15 @@ export default function createHandler<
250250
this.attachGestureHandler(findNodeHandle(this.viewNode) as number); // TODO(TS) - check if this can be null
251251
}
252252

253-
componentDidUpdate() {
253+
override componentDidUpdate() {
254254
const viewTag = findNodeHandle(this.viewNode);
255255
if (this.viewTag !== viewTag) {
256256
this.attachGestureHandler(viewTag as number); // TODO(TS) - check interaction between _viewTag & findNodeHandle
257257
}
258258
this.update(UNRESOLVED_REFS_RETRY_LIMIT);
259259
}
260260

261-
componentWillUnmount() {
261+
override componentWillUnmount() {
262262
this.inspectorToggleListener?.remove();
263263
this.isMountedRef.current = false;
264264
if (Platform.OS !== 'web') {
@@ -442,7 +442,7 @@ export default function createHandler<
442442
this.updateGestureHandler(newConfig);
443443
}
444444

445-
render() {
445+
override render() {
446446
if (__DEV__ && !this.context && !isTestEnv() && Platform.OS !== 'web') {
447447
throw new Error(
448448
name +

0 commit comments

Comments
 (0)