juiceo / react-native-easy-markdown

Simple & customizable React Native component to render Github-flavoured markdown using minimal native components.
https://www.npmjs.com/package/react-native-easy-markdown
65 stars 62 forks source link

In react-native 0.57.7 links in the text throw exception #20

Open agazso opened 5 years ago

agazso commented 5 years ago

It comes from top-level renderApplication as an Invariant violation error (Nesting of <View> within <Text> is not currently supported). It is because links are wrapped in TouchableOpacity in react-native-easy-markdown, and in react-native 0.57.7 the TouchableOpacity contains a View (and animated one).

As a workaround it's possible to use a renderLink function with a TouchableWithoutFeedback, but that lacks the visual feedback that TouchableOpacity have, so it can be considered as a regression.

zivester commented 5 years ago

@agazso I have a PR #23 that replaces TouchableOpacity with TouchableWithoutFeedback. It seems appropriate to me to allow inline links, and if the react native way to do that is only with TouchableWithoutFeedback, than that's the way it should be implemented. Let me know if that works with your application (I'm only on RN 0.55)