nodegui/react-nodegui

Allow use link in Text

donskov opened this issue · 3 comments

Is your feature request related to a problem? Please describe.

Can't use link in Text (like <a href="#">link</a>).

Describe the solution you'd like

<Text
  href="#"
  openExternalLinks={true}
  textInteractionFlags={{
    [TextInteractionFlags.TextBrowserInteraction]: true,
  }}
>
  link
</Text>

Additional context

https://stackoverflow.com/a/8427958

@gregbenner Thanks for the response, but I need to use a link in the text without an extra button.

Your solution helps me:

<Text wordWrap={true} openExternalLinks={true}>
  {`
     <ol>
       <li>
        Open chrome and navigate to chrome://inspect. You should see a target below with your app <a href="https://react.nodegui.org">link</a>.
       </li>
     </ol>
  `}
</Text>

I'll add this as an example to the docs when I get a sec thanks for sharing