microsoft / react-native-windows

A framework for building native Windows apps with React.
https://microsoft.github.io/react-native-windows/
Other
16.42k stars 1.14k forks source link

Remove Patching To TextInputExample.windows.js #5688

Open NickGerleman opened 4 years ago

NickGerleman commented 4 years ago

The examples have some freestanding text inside of properties of a React Element (see "generic generic generic"). The dev-mode React renderer will throw when it sees this, explicitly checking that any text is surrounded by a Text element. This goes through only upstream code, so this will likely affect other platforms and is worth submitting a fix for.

 {
    title: 'Auto-expanding',
    render: function(): React.Node {
      return (
        <View>
          <AutogrowingTextInputExample
            enablesReturnKeyAutomatically={true}
            returnKeyType="done"
            multiline={true}
            style={{maxHeight: 400, minHeight: 20, backgroundColor: '#eeeeee'}}>
            generic generic generic
            <Text style={{fontSize: 6, color: 'red'}}>
              small small small small small small
            </Text>
            <Text>regular regular</Text>
            <Text style={{fontSize: 30, color: 'green'}}>
              huge huge huge huge huge
            </Text>
            generic generic generic
          </AutogrowingTextInputExample>
        </View>
      );
    },
  },
chrisglein commented 4 years ago

Doesn't seem to be supported by Android. Web does something with it, but that's not necessarily standard. Snack

I don't think we're going to support this given that. So hopefully it's okay to submit an upstream change to get rid of it.