Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feature request] Replace matched text by a component #37

Open
WaldoJeffers opened this issue Sep 20, 2017 · 4 comments
Open

[feature request] Replace matched text by a component #37

WaldoJeffers opened this issue Sep 20, 2017 · 4 comments

Comments

@WaldoJeffers
Copy link

WaldoJeffers commented Sep 20, 2017

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 WaldoJeffers changed the title is:issue is:open [feature request] Replace matched text by a component [feature request] Replace matched text by a component Sep 20, 2017
@emilkarl
Copy link

emilkarl commented Jun 1, 2018

Yeah, or images or similar. Would be awesome!

@jm90m
Copy link

jm90m commented Oct 25, 2018

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

@fbartho
Copy link
Contributor

fbartho commented Nov 15, 2018

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
Copy link
Contributor

fbartho commented Jun 11, 2020

related issue: #64
related issue: #68

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants