Skip to content

Commit 9bef5a9

Browse files
committed
throw when <View> exists in <Text>
Copied from: facebook/react-native@6a1b416
1 parent 43e5167 commit 9bef5a9

File tree

3 files changed

+2
-22
lines changed

3 files changed

+2
-22
lines changed

Libraries/Components/View/View.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ const View = createReactClass({
6161

6262
render: function() {
6363
invariant(
64-
!(this.context.isInAParentText && Platform.OS === 'android'),
65-
'Nesting of <View> within <Text> is not supported on Android.');
64+
!this.context.isInAParentText,
65+
'Nesting of <View> within <Text> is not currently supported.');
6666

6767
// WARNING: This method will not be used in production mode as in that mode we
6868
// replace wrapper component View with generated native wrapper RCTView. Avoid

RNTester/js/TextExample.macos.js

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -422,18 +422,6 @@ exports.examples = [
422422
</View>
423423
);
424424
},
425-
}, {
426-
title: 'Inline views',
427-
render: function() {
428-
return (
429-
<View>
430-
<Text>
431-
This text contains an inline blue view <View style={{width: 25, height: 25, backgroundColor: 'steelblue'}} /> and
432-
an inline image <Image source={require('./flux.png')} style={{width: 30, height: 11, resizeMode: 'cover'}}/>. Neat, huh?
433-
</Text>
434-
</View>
435-
);
436-
},
437425
}, {
438426
title: 'Text shadow',
439427
render: function() {

RNTester/js/TextInputExample.macos.js

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -759,14 +759,6 @@ exports.examples = [
759759
style={styles.multiline}
760760
dataDetectorTypes="phoneNumber"
761761
/> */}
762-
<TextInput
763-
placeholder="multiline with children"
764-
multiline={true}
765-
enablesReturnKeyAutomatically={true}
766-
returnKeyType="go"
767-
style={styles.multiline}>
768-
<View style={styles.multilineChild}/>
769-
</TextInput>
770762
</View>
771763
);
772764
}

0 commit comments

Comments
 (0)