I\'m trying to replace parts of a string with JSX tags, like so:
render: function() {
result = this.props.text.replace(\":\",
Nothing around WEB globe worked for me exept this solution - https://www.npmjs.com/package/regexify-string
Working with React, strings and doesn't have any additional dependecies
regexifyString({
pattern: /\[.*?\]/gim,
decorator: (match, index) => {
return (
{match}
);
},
input: 'Some text with [link]',
});