Skip to content

Commit 1f62d5c

Browse files
committed
private isInitialized
1 parent b738254 commit 1f62d5c

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

packages/react-native-gesture-handler/src/web/handlers/NativeViewGestureHandler.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ export default class NativeViewGestureHandler extends GestureHandler {
4545
if (this.config.disallowInterruption !== undefined) {
4646
this.disallowInterruption = this.config.disallowInterruption;
4747
}
48-
if (this.delegate.isInitialized) {
48+
if (this.delegate.initialized) {
4949
// this function is called on handler creation, which happens before initializing delegate
5050
const view = this.delegate.view as HTMLElement;
5151
this.restoreViewStyles(view);

packages/react-native-gesture-handler/src/web/tools/GestureHandlerDelegate.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export interface MeasureResult {
88
}
99

1010
export interface GestureHandlerDelegate<TComponent, THandler> {
11-
isInitialized: boolean;
11+
readonly initialized: boolean;
1212
view: TComponent;
1313

1414
init(viewRef: number, handler: THandler): void;

packages/react-native-gesture-handler/src/web/tools/GestureHandlerWebDelegate.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ interface DefaultViewStyles {
2222
export class GestureHandlerWebDelegate
2323
implements GestureHandlerDelegate<HTMLElement, IGestureHandler>
2424
{
25-
public isInitialized = false;
25+
private isInitialized = false;
2626
private _view: HTMLElement | null = null;
2727

2828
private gestureHandler!: IGestureHandler;
@@ -240,7 +240,12 @@ export class GestureHandlerWebDelegate
240240

241241
return this._view;
242242
}
243+
243244
public set view(value: HTMLElement) {
244245
this._view = value;
245246
}
247+
248+
get initialized(): boolean {
249+
return this.isInitialized;
250+
}
246251
}

0 commit comments

Comments
 (0)