Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

20
  • 41
    This is great, the only comment I have is that you could have used the official Keyboard api in RN, and called Keyboard.dismiss() instead of calling some RN internal utility dismissKeyboard(). But both work fine currently. Commented Dec 9, 2016 at 9:04
  • 3
    This works great. I had to change the syntax a little for the definition of the arrow function, to remove an unexpected token error in RN: const DismissKeyboardHOC = (Comp) => { Commented Sep 26, 2017 at 20:47
  • 4
    I can't get onPress for TouchableWithoutFeedback to fire no matter what I try Commented Nov 1, 2017 at 20:30
  • 4
    This solution works, but please keep in mind that you can not use swipe gestures in children of a Touchable component. Commented Apr 15, 2018 at 14:34
  • 2
    Why create an HoC and just add this in the root of your app tree / Commented Apr 26, 2020 at 15:52