Skip to content

Commit 0ff0255

Browse files
committed
Unify reactStringReplace vs reactReplaceString
1 parent b435f4a commit 0ff0255

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

example/index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React, { PropTypes } from 'react';
22
import { render } from 'react-dom';
3-
import reactReplaceString from 'react-string-replace';
3+
import reactStringReplace from 'react-string-replace';
44

55
const Demo = React.createClass({
66
propTypes: {
@@ -18,17 +18,17 @@ const Demo = React.createClass({
1818
let replacedText;
1919

2020
// Match URLs
21-
replacedText = reactReplaceString(text, /(https?:\/\/\S+)/g, match => (
21+
replacedText = reactStringReplace(text, /(https?:\/\/\S+)/g, match => (
2222
<a key={match} href={match}>{match}</a>
2323
));
2424

2525
// Match @-mentions
26-
replacedText = reactReplaceString(replacedText, /@(\w+)/g, match => (
26+
replacedText = reactStringReplace(replacedText, /@(\w+)/g, match => (
2727
<a key={match} href={`https://twitter.com/${match}`}>@{match}</a>
2828
));
2929

3030
// Match hashtags
31-
replacedText = reactReplaceString(replacedText, /#(\w+)/g, match => (
31+
replacedText = reactStringReplace(replacedText, /#(\w+)/g, match => (
3232
<a key={match} href={`https://twitter.com/hashtag/${match}`}>#{match}</a>
3333
));
3434

0 commit comments

Comments
 (0)