Skip to content

Deprecate pasted-text fallback in useInput and make usePaste the only paste API #921

Description

@sindresorhus

Probably not soon, but at some point.


Summary

useInput currently still receives pasted text when no usePaste listener is active. This is legacy behavior and makes input semantics inconsistent.

Proposal

  • Deprecate pasted-text delivery via useInput in the current major.
  • In the next major, stop forwarding bracketed paste payloads to useInput.
  • Keep usePaste as the dedicated API for paste blobs.

Why

  • Clearer API boundaries: key events (useInput) vs paste blobs (usePaste).
  • Simpler handlers: no mixed key/paste assumptions in one callback.
  • More predictable behavior across terminals.

Migration

If your app relies on pasted text in useInput, switch to usePaste for paste handling and keep useInput for typed key events.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions