RN: Consistently Throw for <Text><View /></Text>
Reviewed By: sahrens Differential Revision: D7898238 fbshipit-source-id: a2b74e691a116b1beae3c6bb266252a722aacbb1
This commit is contained in:
parent
3e534b9aab
commit
6a1b41643a
|
@ -63,10 +63,9 @@ if (__DEV__) {
|
||||||
ViewToExport = React.forwardRef((props, ref) => (
|
ViewToExport = React.forwardRef((props, ref) => (
|
||||||
<TextAncestor.Consumer>
|
<TextAncestor.Consumer>
|
||||||
{hasTextAncestor => {
|
{hasTextAncestor => {
|
||||||
// TODO: Change iOS to behave the same as Android.
|
|
||||||
invariant(
|
invariant(
|
||||||
!hasTextAncestor || Platform.OS !== 'android',
|
!hasTextAncestor,
|
||||||
'Nesting of <View> within <Text> is not supported on Android.',
|
'Nesting of <View> within <Text> is not currently supported.',
|
||||||
);
|
);
|
||||||
return <RCTView {...props} ref={ref} />;
|
return <RCTView {...props} ref={ref} />;
|
||||||
}}
|
}}
|
||||||
|
|
|
@ -872,14 +872,6 @@ exports.examples = [
|
||||||
style={styles.multiline}
|
style={styles.multiline}
|
||||||
dataDetectorTypes="phoneNumber"
|
dataDetectorTypes="phoneNumber"
|
||||||
/>
|
/>
|
||||||
<TextInput
|
|
||||||
placeholder="multiline with children"
|
|
||||||
multiline={true}
|
|
||||||
enablesReturnKeyAutomatically={true}
|
|
||||||
returnKeyType="go"
|
|
||||||
style={styles.multiline}>
|
|
||||||
<View style={styles.multilineChild}/>
|
|
||||||
</TextInput>
|
|
||||||
</View>
|
</View>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue