Caret-preserving
A remote value update leaves the caret and selection where the user had them.
A React drop-in for native <input> and <textarea> that preserves caret, selection, and scroll when the value prop is updated from a remote source.
pnpm add react-multiplayer-inputnpm install react-multiplayer-inputyarn add react-multiplayer-inputbun add react-multiplayer-inputPeer dependency: react ^19. See the getting started guide for usage.
The multiplayer textarea on the left and a native textarea on the right share the same value via BroadcastChannel. Open this page in another tab to see the value sync. Start the auto-typer to compare cursor behavior.
See Known limitations for context on each.