Reland D38460202 and fix tests
Reland D38460202 and fix tests

Summary: Reland D38460202 (https://github.com/facebook/react-native/commit/e874e5facb60ff7057c0c95ca53948540ddb7137) and fix test errors.

Reviewed By: RSNara

Differential Revision: D38846070

fbshipit-source-id: 05a889aabe7e25225ff7464f69900c459c82dd47

janicduplessis/react-native,javache/react-native,janicduplessis/react-native,janicduplessis/react-native,javache/react-native,facebook/react-native,facebook/react-native,facebook/react-native,facebook/react-native,janicduplessis/react-native,facebook/react-native,facebook/react-native,janicduplessis/react-native,javache/react-native,javache/react-native,facebook/react-native,janicduplessis/react-native,janicduplessis/react-native,javache/react-native,javache/react-native,javache/react-native,janicduplessis/react-native,javache/react-native,javache/react-native,facebook/react-native,facebook/react-native