resets the focus to the decor view.
$ npm install react-native-reset-focus --save
$ react-native link react-native-reset-focus
- Open up
android/app/src/main/java/[...]/MainActivity.java
- Add
import com.reactlibrary.RNResetFocusPackage;
to the imports at the top of the file - Add
new RNResetFocusPackage()
to the list returned by thegetPackages()
method
- Append the following lines to
android/settings.gradle
:include ':react-native-reset-focus' project(':react-native-reset-focus').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-reset-focus/android')
- Insert the following lines inside the dependencies block in
android/app/build.gradle
:compile project(':react-native-reset-focus')
import RNResetFocus from 'react-native-reset-focus';
RNResetFocus.resetFocus();