react-native-parsed-text icon indicating copy to clipboard operation
react-native-parsed-text copied to clipboard

[feature request] Replace matched text by a component

Open WaldoJeffers opened this issue 8 years ago • 4 comments

Hello,

Great module! I'd like to propose a feature request, and see if other people would be interested in this: I have a use case where I need to match text fragments and replace them with some other texts which need to be wrapped in <TouchableOpacity /> components, to make them easily clickable/tapable. Currently, as renderText only accepts strings as output values, this is not possible. But this also implies that the root component returned by <ParsedText /> needs to be a <View> component rather than a <Text> component, since React Native only does not allow <View> components to be nested in <Text> components.

What do you think?

WaldoJeffers avatar Sep 20 '17 13:09 WaldoJeffers

Yeah, or images or similar. Would be awesome!

emilkarl avatar Jun 01 '18 12:06 emilkarl

Yeah this feature would be great, or make another setting to renderComponent so we can choose the parent component and child components to render.

jm90m avatar Oct 25 '18 02:10 jm90m

This is great, but currently, today, react-native doesn't support arbitrary components embedded inside a text-components. -- This may be a difficult feature to build, as you'd have to split text subcomponents into bits, and figure out how the rendering & layout would work. If a PR has this working, I'd be happy to review it!

fbartho avatar Nov 15 '18 21:11 fbartho

related issue: #64 related issue: #68

fbartho avatar Jun 11 '20 00:06 fbartho