react-linkify: Target Blank Doesn't Work
When I do:
<Linkify properties={{ target: '_blank' }}>
{description}
</Linkify>
and description equals:
The JSON Query expression. Reference: http://docs.jsonata.org
it will render:
The JSON Query expression. Reference: <a href="http://docs.jsonata.org">http://docs.jsonata.org</a>
with version:
"react-linkify": "^1.0.0-alpha",
About this issue
- Original URL
- State: open
- Created 4 years ago
- Reactions: 19
- Comments: 16
As a workaround, you can do:
You can create a decorator like some of the other comments here have mentioned. If you want to open new tabs securely, especially if the links are leaving the site you control, I suggest implementing the following:
TypeScript supported CodeSandbox: https://codesandbox.io/s/cool-montalcini-vkmtb?file=/src/App.tsx
npm install react-secure-link…then…
<Linkify options={{target:'blank'}}> {data} </Linkify>this is helpful and working fineThanks, this worked for me
Guess this library’s dead right? Wanted to use it in production due it’s size, bummer.