@@ -154,6 +154,20 @@ export type Props = $ReadOnly<{|
154
154
onOrientationChange ?: ?DirectEventHandler < OrientationChangeEvent > ,
155
155
| } > ;
156
156
157
+ function confirmProps ( props : Props ) {
158
+ if ( __DEV__ ) {
159
+ if (
160
+ props . presentationStyle &&
161
+ props . presentationStyle !== 'overFullScreen' &&
162
+ props . transparent === true
163
+ ) {
164
+ console . warn (
165
+ `Modal with '${ props . presentationStyle } ' presentation style and 'transparent' value is not supported.` ,
166
+ ) ;
167
+ }
168
+ }
169
+ }
170
+
157
171
class Modal extends React . Component < Props > {
158
172
static defaultProps : { | hardwareAccelerated : boolean , visible : boolean | } = {
159
173
visible : true ,
@@ -167,7 +181,9 @@ class Modal extends React.Component<Props> {
167
181
168
182
constructor ( props : Props ) {
169
183
super ( props ) ;
170
- Modal . _confirmProps ( props ) ;
184
+ if ( __DEV__ ) {
185
+ confirmProps ( props ) ;
186
+ }
171
187
this . _identifier = uniqueModalIdentifier ++ ;
172
188
}
173
189
@@ -190,19 +206,9 @@ class Modal extends React.Component<Props> {
190
206
}
191
207
}
192
208
193
- UNSAFE_componentWillReceiveProps ( nextProps : Props ) {
194
- Modal . _confirmProps ( nextProps ) ;
195
- }
196
-
197
- static _confirmProps ( props : Props ) {
198
- if (
199
- props . presentationStyle &&
200
- props . presentationStyle !== 'overFullScreen' &&
201
- props . transparent === true
202
- ) {
203
- console . warn (
204
- `Modal with '${ props . presentationStyle } ' presentation style and 'transparent' value is not supported.` ,
205
- ) ;
209
+ componentDidUpdate ( ) {
210
+ if ( __DEV__ ) {
211
+ confirmProps ( this . props ) ;
206
212
}
207
213
}
208
214
0 commit comments