# What changed in react-highlight-words

> 27 changes in react-highlight-words 0.21 to 1 from its official release notes, upgrade guides and advisories: 11 breaking, 4 new APIs and options. Each one cited. Sources checked 2026-10-18. HTML: https://unstale.sh/npm/react-highlight-words/

To see which of these apply to a repository, run `npx @unstale/cli init` in it.

## react-highlight-words 1

### Breaking changes

- String search words are matched literally by default because autoEscape now defaults to true. (1.0.0) — [release notes](https://github.com/bvaughn/react-highlight-words/releases/tag/1.0.0)
- The exported Chunk type now requires searchIndex, the index of the matching search word. (1.0.0) — [release notes](https://github.com/bvaughn/react-highlight-words/releases/tag/1.0.0)
- highlight-words-core 2.0 is published as ES2020, so environments and bundlers that cannot parse that syntax need to transpile it. (1.0.0) — [release notes](https://github.com/bvaughn/react-highlight-words/releases/tag/1.0.0)
- Only the package root can be imported; deep imports are no longer available. (1.0.0) — [release notes](https://github.com/bvaughn/react-highlight-words/releases/tag/1.0.0)
- Custom findChunks functions must return searchIndex in each chunk and now receive every option with its default applied. (1.0.0) — [release notes](https://github.com/bvaughn/react-highlight-words/releases/tag/1.0.0)
- React 16.3 or newer is required; React 0.14, 15, and 16.0–16.2 are no longer supported. (1.0.0) — [release notes](https://github.com/bvaughn/react-highlight-words/releases/tag/1.0.0)
- A ref is forwarded to the outer wrapper span; this requires React 16.3 or newer. (1.0.0) — [release notes](https://github.com/bvaughn/react-highlight-words/releases/tag/1.0.0)
- When sanitize changes text, it is applied to each character separately, so context-dependent sanitizers produce different results. (1.0.0) — [release notes](https://github.com/bvaughn/react-highlight-words/releases/tag/1.0.0)

### New APIs and options

- FoundChunk is exported as an alias of Chunk, matching its name in highlight-words-core. (1.0.0) — [release notes](https://github.com/bvaughn/react-highlight-words/releases/tag/1.0.0)
- Custom highlightTag components receive searchIndex, identifying the matching search word. (1.0.0) — [release notes](https://github.com/bvaughn/react-highlight-words/releases/tag/1.0.0)

### Behavior and default changes

- When autoEscape is false, invalid regular-expression strings are matched literally instead of throwing an error. (1.0.0) — [release notes](https://github.com/bvaughn/react-highlight-words/releases/tag/1.0.0)
- Search words can include RegExp objects, which are used as-is with their own flags. (1.0.0) — [release notes](https://github.com/bvaughn/react-highlight-words/releases/tag/1.0.0)

### Fixes and other changes

- Inactive matches no longer have a trailing space in their class name, and elements without a class name no longer render an empty class attribute. (1.0.0) — [release notes](https://github.com/bvaughn/react-highlight-words/releases/tag/1.0.0)
- CommonJS consumers now get correct component and namespace types, including with node16 module resolution. (1.0.0) — [release notes](https://github.com/bvaughn/react-highlight-words/releases/tag/1.0.0)
- For object values, unmatched text uses the class of the search word that matched instead of an undefined class name. (1.0.0) — [release notes](https://github.com/bvaughn/react-highlight-words/releases/tag/1.0.0)
- Object values no longer give matches such as constructor or toString a class name from inherited properties. (1.0.0) — [release notes](https://github.com/bvaughn/react-highlight-words/releases/tag/1.0.0)
- Matches line up with the original text when sanitize changes its length. (1.0.0) — [release notes](https://github.com/bvaughn/react-highlight-words/releases/tag/1.0.0)
- searchWords can be a readonly array, allowing values such as arrays declared with as const. (1.0.0) — [release notes](https://github.com/bvaughn/react-highlight-words/releases/tag/1.0.0)
- Surrogate pairs such as emoji are no longer split between highlighted and unhighlighted text. (1.0.0) — [release notes](https://github.com/bvaughn/react-highlight-words/releases/tag/1.0.0)
- A missing or non-string textToHighlight from untyped callers no longer throws an error. (1.0.0) — [release notes](https://github.com/bvaughn/react-highlight-words/releases/tag/1.0.0)

## react-highlight-words 0.21

### Breaking changes

- Removes the UMD build. (0.21.1) — [release notes](https://github.com/bvaughn/react-highlight-words/releases/tag/0.21.1)
- Stops bundling highlight-words-core and installs it as a regular dependency at ^1.2.0. (0.21.1) — [release notes](https://github.com/bvaughn/react-highlight-words/releases/tag/0.21.1)
- The package targets ES2018+ syntax instead of ES5; environments unable to parse it need to transpile the package. (0.21.1) — [release notes](https://github.com/bvaughn/react-highlight-words/releases/tag/0.21.1)

### New APIs and options

- Adds TypeScript definitions, including HighlighterProps, HighlightTagProps, UnhighlightTagProps, Chunk and FindChunksOptions. (0.21.1) — [release notes](https://github.com/bvaughn/react-highlight-words/releases/tag/0.21.1)
- Adds an ES module build and exposes it through the package's module field. (0.21.1) — [release notes](https://github.com/bvaughn/react-highlight-words/releases/tag/0.21.1)

### Performance

- When caseSensitive is false, lowercases object keys once per render instead of once per match. (0.21.1) — [release notes](https://github.com/bvaughn/react-highlight-words/releases/tag/0.21.1)

### Tooling

- Moves the CommonJS entry point from dist/main.js; require("react-highlight-words") still returns the component directly. (0.21.1) — [release notes](https://github.com/bvaughn/react-highlight-words/releases/tag/0.21.1)
