Summary:
Fixes#21243.
Fixes#20908.
Credit goes to superandrew213 who provided the patch based on 0.56; this commit merges and resolved the conflict introduced in 0.57.
Pull Request resolved: https://github.com/facebook/react-native/pull/21951
Differential Revision: D13980799
Pulled By: cpojer
fbshipit-source-id: 6b9f1a1ae54ad9dba043005d683d6a221472c729