Skip to content

v1.2.0

Choose a tag to compare

@iansinnott iansinnott released this 01 Jan 23:35
· 5 commits to master since this release

What's Changed

New Features

  • Added optional count parameter to limit the number of replacements (#91)
// Replace only the first match
reactStringReplace('hey hey hey', 'hey', (match) => <span>{match}</span>, 1);
// => ['', <span>hey</span>, ' ', 'hey', ' ', 'hey', '']

Bug Fixes

  • Fixed crash when using RegExp patterns with the count parameter

Full Changelog: v1.1.2...v1.2.0