Skip to content

Nested <Text> clicks #1030

@agentcooper

Description

@agentcooper

Hey.

I want to render some hypertext, e.g

var hypertext = 'this is <a href="http://facebook.com">facebook.com</a> link';

I tried programmatically splitting into

<Text>
  <Text>this is </Text>
  <Text onPress={this.onLinkPress} style={{color: '#0000ff'}}>facebook.com</Text>
  <Text> link</Text>
</Text>

but obviously onPress wouldn't work, because nested text is transformed.

  1. Should a message be thrown if onPress is being set on the nested text?
  2. Is there any good way to get a click handler on the link?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions