Skip to main content
added another approach
Source Link
Adeel Imran
  • 14.1k
  • 8
  • 66
  • 80
const dismissKeyboard = require('dismissKeyboard'); dismissKeyboard(); //dismisses it 

Approach No# 2;

Thanks to user @ricardo-stuven for pointing this out, there is another better way to dismiss the keyboard which you can see in the example in the react native docs.

Simple import Keyboard and call it's method dismiss()

const dismissKeyboard = require('dismissKeyboard'); dismissKeyboard(); //dismisses it 
const dismissKeyboard = require('dismissKeyboard'); dismissKeyboard(); //dismisses it 

Approach No# 2;

Thanks to user @ricardo-stuven for pointing this out, there is another better way to dismiss the keyboard which you can see in the example in the react native docs.

Simple import Keyboard and call it's method dismiss()

added 6 characters in body
Source Link
Petter Friberg
  • 21.8k
  • 10
  • 67
  • 116

const dismissKeyboard = require('dismissKeyboard'); dismissKeyboard(); //dismisses it

const dismissKeyboard = require('dismissKeyboard'); dismissKeyboard(); //dismisses it 

const dismissKeyboard = require('dismissKeyboard'); dismissKeyboard(); //dismisses it

const dismissKeyboard = require('dismissKeyboard'); dismissKeyboard(); //dismisses it 
Source Link
Adeel Imran
  • 14.1k
  • 8
  • 66
  • 80

const dismissKeyboard = require('dismissKeyboard'); dismissKeyboard(); //dismisses it