diff --git a/src/components/Linkify.jsx b/src/components/Linkify.jsx index a765494..7f4832f 100644 --- a/src/components/Linkify.jsx +++ b/src/components/Linkify.jsx @@ -4,7 +4,7 @@ import * as React from 'react'; import defaultComponentDecorator from 'decorators/defaultComponentDecorator'; import defaultHrefDecorator from 'decorators/defaultHrefDecorator'; -import defaultMatchDecorator from 'decorators/defaultMatchDecorator'; +import defaultMatchDecorator, { linkify } from 'decorators/defaultMatchDecorator'; import defaultTextDecorator from 'decorators/defaultTextDecorator'; type Props = { @@ -78,4 +78,6 @@ class Linkify extends React.Component { } } +export { linkify }; + export default Linkify; diff --git a/src/decorators/defaultMatchDecorator.js b/src/decorators/defaultMatchDecorator.js index 1150218..842b7d7 100644 --- a/src/decorators/defaultMatchDecorator.js +++ b/src/decorators/defaultMatchDecorator.js @@ -6,6 +6,8 @@ import tlds from 'tlds'; const linkify = new LinkifyIt(); linkify.tlds(tlds); +export { linkify }; + export default (text: string): Array => { return linkify.match(text); }; diff --git a/src/index.js b/src/index.js index 9119c85..7007df4 100644 --- a/src/index.js +++ b/src/index.js @@ -1,3 +1,5 @@ -import Linkify from 'components/Linkify'; +import Linkify, { linkify } from 'components/Linkify'; + +export { linkify }; export default Linkify;