From e0decdbc5e51fc02bce3f611735fe78abccfd2e4 Mon Sep 17 00:00:00 2001 From: Steen Limuel Date: Thu, 9 Jul 2020 20:47:34 +0900 Subject: [PATCH] Fix elements not rendering on v0.63.0 ...while supporting the HOC usage --- lib/KeyboardAwareHOC.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/KeyboardAwareHOC.js b/lib/KeyboardAwareHOC.js index 4bf0ed0..10b7106 100644 --- a/lib/KeyboardAwareHOC.js +++ b/lib/KeyboardAwareHOC.js @@ -545,8 +545,11 @@ function KeyboardAwareHOC( // Allow to pass options, without breaking change, and curried for composition // listenToKeyboardEvents(ScrollView); // listenToKeyboardEvents(options)(Comp); -const listenToKeyboardEvents = (configOrComp: any) => { - if (typeof configOrComp === 'object') { +const listenToKeyboardEvents = (configOrComp: React.ReactElement | KeyboardAwareHOCProps) => { + if(configOrComp?.displayName === "ScrollView") { + return KeyboardAwareHOC(configOrComp) + } + else if (typeof configOrComp === 'object') { return (Comp: Function) => KeyboardAwareHOC(Comp, configOrComp) } else { return KeyboardAwareHOC(configOrComp)