Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions src/handlers/createHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,16 @@ type InternalEventHandlers = {
onGestureHandlerStateChange?: (event: any) => void;
};

let showedRngh2Notice = false;
function showRngh2NoticeIfNeeded() {
if (!showedRngh2Notice) {
console.warn(
"[react-native-gesture-handler] Seems like you're using an old API with gesture components, check out new Gestures system!"
);
showedRngh2Notice = true;
}
}

// TODO(TS) - make sure that BaseGestureHandlerProps doesn't need other generic parameter to work with custom properties.
export default function createHandler<
T extends BaseGestureHandlerProps<U>,
Expand Down Expand Up @@ -162,6 +172,9 @@ export default function createHandler<
}
handlerIDToTag[props.id] = this.handlerTag;
}
if (__DEV__) {
showRngh2NoticeIfNeeded();
}
}

componentDidMount() {
Expand Down