-
Notifications
You must be signed in to change notification settings - Fork 647
children not rendering anything after upgrading to RN 0.63.0 #429
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
the same issue with me |
Same here |
It's happening with me too. Does anyone has any solution? |
This change to ScrollView facebook/react-native@d2f314a Trips up the listenToKeyboardEvents function in A workaround is to create your own KeyboardAwareScrollView by wrapping ScrollView in the listenToKeyboardEvents function.
|
I created my own simple component as a replacement:
|
Using react-native@0.63.0-rc.1, it seems like type of
Using a custom build with the options version of the function removed fixes the issue for me: diff --git a/lib/KeyboardAwareHOC.js b/lib/KeyboardAwareHOC.js
index c6e1469..496068b 100644
--- a/lib/KeyboardAwareHOC.js
+++ b/lib/KeyboardAwareHOC.js
@@ -541,11 +541,7 @@ function KeyboardAwareHOC(
// listenToKeyboardEvents(ScrollView);
// listenToKeyboardEvents(options)(Comp);
const listenToKeyboardEvents = (configOrComp: any) => {
- if (typeof configOrComp === 'object') {
- return (Comp: Function) => KeyboardAwareHOC(Comp, configOrComp)
- } else {
- return KeyboardAwareHOC(configOrComp)
- }
+ return KeyboardAwareHOC(configOrComp)
}
export default listenToKeyboardEvents |
->Fix children not rendering anything after upgrading to RN 0.63.0 ->Fix from APSL#429 (comment)
I sent a different pull request for people who still want the HOC to be usable with configs, but I'm not sure if the maintainer will look at them anytime soon. Also, this naive fix is assuming that only ScrollViews are recognized as - 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') { |
Simply, I use KeyboardAvoidingView and ScrollView. Working perfectly. |
React-native 0.63.0 have been released and it has still issue |
I have forked the repo to fix this issue.
|
Fix #429 for broken react-native 0.63.0. Detect Forwarding Refs
@rborn can you tag a new version? npm is installing an older version still |
@bneigher don't have yet npm rights :) working on it, will let you know |
@rborn you can still make the tag and version in github, and npm should be able to recognize the new code. |
but for now I can hardcode github / master in my package.json |
@bneigher tag created, I talked to the owner of the package and he'll push to npm when he has a little time :) |
well, since this repo is dying, react-native has already solved this problem. KeyboardAvoidingView and it is really easy to use.
that is all you need to add and it will fix it. |
@codler thanks for publishing the fork I tried the options from @CyrusZei and @kesha-antonov And found they both resulted in strange whitespace being added to android on my forms and on ios I found pressing next on the keyboard didn't always scroll down to the next input. especially on the last input in a form Using the fork was the best option for me, as it resulted in making no changes to the existing forms in my app |
@codler Thanks too |
Thanks @codler ! |
After upgrading, it seems that this component may have broken. Does anyone else see this happening?
The text was updated successfully, but these errors were encountered: