Skip to content
This repository has been archived by the owner on Nov 27, 2022. It is now read-only.

Commit

Permalink
fix: use currentlyFocusedInput for latest RN (#1010)
Browse files Browse the repository at this point in the history
Replaced the currentlyFocusedField method with currentlyFocusedInput method. This fixes the error "currentlyFocusedField is deprecated and will be removed in a future release. Use currentlyFocusedInput".

### Motivation
CurrentlyFocusedField is deprecated.
Error being thrown when swiping with react-navigation. 

Co-authored-by: Satyajit Sahoo <satyajit.happy@gmail.com>
  • Loading branch information
MaxEgg and satya164 committed Jun 25, 2020
1 parent c36a916 commit a91ff87
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Pager.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -621,7 +621,9 @@ export default class Pager<T extends Route> extends React.Component<
this.interactionHandle = InteractionManager.createInteractionHandle();

if (keyboardDismissMode === 'auto') {
const input = TextInput.State.currentlyFocusedField();
const input = TextInput.State.currentlyFocusedInput
? TextInput.State.currentlyFocusedInput()
: TextInput.State.currentlyFocusedField();

// When a gesture begins, blur the currently focused input
TextInput.State.blurTextInput(input);
Expand Down

0 comments on commit a91ff87

Please sign in to comment.