From 45b0907f619f455825f459838615a5a7cc59a204 Mon Sep 17 00:00:00 2001 From: Blair Vanderhoof Date: Wed, 10 Jul 2019 12:39:15 -0700 Subject: [PATCH] Fix ScrollView context warning in Modal.js Summary: This fixes the following warning from appearing when you have a FlatList render a Modal where the content of the Modal also contains a FlatList: https://fburl.com/p953k985. Spencer addressed an issue similar to this in D7863625, but we still get a yellow box due to the fact that `scrollContext` still exists, but `this.context.virtualizedList` is null from this line in Modal.js https://fburl.com/nqc261a1. Reviewed By: cpojer Differential Revision: D16160666 fbshipit-source-id: ba222d3eef234f4c8c4c2bddbc71bec27df81e0a --- Libraries/Modal/Modal.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Libraries/Modal/Modal.js b/Libraries/Modal/Modal.js index 38e77f34f8325f..46466eb4b2aaf7 100644 --- a/Libraries/Modal/Modal.js +++ b/Libraries/Modal/Modal.js @@ -17,6 +17,7 @@ import NativeModalManager from './NativeModalManager'; const Platform = require('../Utilities/Platform'); const React = require('react'); const PropTypes = require('prop-types'); +const ScrollView = require('../Components/ScrollView/ScrollView'); const StyleSheet = require('../StyleSheet/StyleSheet'); const View = require('../Components/View/View'); @@ -258,7 +259,11 @@ class Modal extends React.Component { onStartShouldSetResponder={this._shouldSetResponder} supportedOrientations={this.props.supportedOrientations} onOrientationChange={this.props.onOrientationChange}> - {innerChildren} + + + {innerChildren} + + ); }