Comments (6)
Facing same issue
from react-linkify.
Adding on top of what @teddybee mentioned above, linkify is used in the match decorator:
react-linkify/src/decorators/defaultMatchDecorator.js
Lines 3 to 11 in 325cb5e
Therefore if we want to use a customized version of linkify, we can create a custom match decorator with a new LinkifyIt
instance,
import Linkify from "react-linkify";
import LinkifyIt, { Match } from "linkify-it";
const linkify = new LinkifyIt();
linkify.tlds(tlds);
linkify.add("@", {
// Add custom feature here
});
const matchDecorator = (text: string): Match[] | null => {
return linkify.match(text);
};
and use Linkify component with the decorator:
<Linkify
matchDecorator={matchDecorator}
>
...
</Linkify>
from react-linkify.
You need to import it like so:
import Linkify from 'react-linkify'
from react-linkify.
@Gr8z this is not the same thing
from react-linkify.
The typedef declaration is missing for that export, and it is using linkify-it package. If you want to customize something, probably should use the componentDecorator property and look at the package's defaultComponentDecorator.js.
from react-linkify.
See #108. 😉
from react-linkify.
Related Issues (20)
- Linkify not working on contentEditable component HOT 1
- Support for clickable phone number
- package not working on mobile ( iphone & android ) HOT 1
- When I use dangerouslySetInnerHTML it doesn't linkify HOT 3
- Any chance for multiline support? HOT 1
- ESM import issue causing: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: object. HOT 1
- String text passed in as a value in <textarea> does not seem to be supported with react-linkify HOT 1
- Can't identity the links with whitespaces HOT 1
- Error when using "react-linkify" in a Next.js app
- Quoted email addresses do not link properly
- Email addresses will not parse correctly HOT 1
- Latest Dist is not latest build HOT 2
- The properties don't work when in Semantic UI <Comments> HOT 13
- Readme and example site is outdated HOT 2
- Homograph attack (Security) HOT 2
- Invariant Violation HOT 2
- Props don't work HOT 1
- Target Blank Doesn't Work HOT 16
- React Linkify - Properties is not working HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-linkify.