react-linkifier demo

node v6.17.1
version: 2.0.0
endpointsharetweet
const React = require("react"); const ReactDOMServer = require("react-dom/server"); const Linkifier = require("react-linkifier@3.0.0").default; const BigLink = ({href, children}) => <a style={{color: 'red', fontSize: 30}}>{children}</a>; ReactDOMServer.renderToStaticMarkup( <div> <Linkifier> <ul> <li>Urls inside braces (example.org)</li> <li>Urls inside weird braces {"{<[(http://example.org)]>}"}</li> <li>Emails user@example.org</li> <li>Trailing punctuation marks not converted, for example: example.org, example.org/path.</li> </ul> </Linkifier> <Linkifier renderer={BigLink}> Custom renderer: example.org </Linkifier> <Linkifier protocol="ftp"> <div>This will point to a FTP: example.org</div> </Linkifier> </div> );
Loading…

no comments

    sign in to comment