Skip to content

Commit 6a1b416

Browse files
yungstersfacebook-github-bot
authored andcommitted
RN: Consistently Throw for <Text><View /></Text>
Reviewed By: sahrens Differential Revision: D7898238 fbshipit-source-id: a2b74e691a116b1beae3c6bb266252a722aacbb1
1 parent 3e534b9 commit 6a1b416

File tree

2 files changed

+2
-11
lines changed

2 files changed

+2
-11
lines changed

Diff for: Libraries/Components/View/View.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,9 @@ if (__DEV__) {
6363
ViewToExport = React.forwardRef((props, ref) => (
6464
<TextAncestor.Consumer>
6565
{hasTextAncestor => {
66-
// TODO: Change iOS to behave the same as Android.
6766
invariant(
68-
!hasTextAncestor || Platform.OS !== 'android',
69-
'Nesting of <View> within <Text> is not supported on Android.',
67+
!hasTextAncestor,
68+
'Nesting of <View> within <Text> is not currently supported.',
7069
);
7170
return <RCTView {...props} ref={ref} />;
7271
}}

Diff for: RNTester/js/TextInputExample.ios.js

-8
Original file line numberDiff line numberDiff line change
@@ -872,14 +872,6 @@ exports.examples = [
872872
style={styles.multiline}
873873
dataDetectorTypes="phoneNumber"
874874
/>
875-
<TextInput
876-
placeholder="multiline with children"
877-
multiline={true}
878-
enablesReturnKeyAutomatically={true}
879-
returnKeyType="go"
880-
style={styles.multiline}>
881-
<View style={styles.multilineChild}/>
882-
</TextInput>
883875
</View>
884876
);
885877
}

0 commit comments

Comments
 (0)