Skip to content

Instantly share code, notes, and snippets.

@WrathChaos
Created December 14, 2019 15:30
Show Gist options
  • Save WrathChaos/83b409e1a2682f9d6edd6ee923d5d4cb to your computer and use it in GitHub Desktop.
Save WrathChaos/83b409e1a2682f9d6edd6ee923d5d4cb to your computer and use it in GitHub Desktop.
React Native: How to close the keyboard programmatically?
import { Keyboard } from "react-native";

// USAGE

<TouchableOpacity onPress={() => Keyboard.dismiss()} /> 

// Simply
Keyboard.dismiss();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment