Skip to content

Issue using <View> with renderLink  #48

Closed
@tomeberle

Description

@tomeberle

Hi there,

I am trying to create a newsfeed with automatic links previewing that would look like the following example from react-native-url-preview.

Screenshot 2020-03-19 at 17 27 39

In order to detect URLs within the text of each posts, I am using this great autolink library. Then, �I hopped to use 'renderLink' prop to design and render the preview of the link.

However, there is a limitation from the library as renderLink can only return a Text component. So when I try to add a view to renderLink like the following:

renderLink={(text, match, index) => (<View><Text>{text}</Text></View)}

I get those funny file icons:
Screenshot 2020-03-19 at 17 36 53

Would someone see anyway I could tackle this issue ?

Thanks for the help!

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions