Skip to content

refactor(TextInput): deprecate inputRef prop#3446

Open
mvanhorn wants to merge 1 commit intotrussworks:mainfrom
mvanhorn:osc/3016-deprecate-inputref
Open

refactor(TextInput): deprecate inputRef prop#3446
mvanhorn wants to merge 1 commit intotrussworks:mainfrom
mvanhorn:osc/3016-deprecate-inputref

Conversation

@mvanhorn
Copy link

Summary

Deprecates the inputRef prop on TextInput. Adds a @deprecated JSDoc annotation and a runtime console.warn when inputRef is passed. Users should use the ref prop instead, which was added in #3011.

Why this matters

inputRef is now redundant since forwardRef support was added. This deprecation gives users a migration path before removal in a future major version.

Changes

  • src/components/forms/TextInput/TextInput.tsx: Added @deprecated JSDoc tag to inputRef prop definition and a useEffect that logs a deprecation warning when inputRef is used.

Testing

This is a deprecation notice only - no behavioral changes. The existing tests should pass unchanged since inputRef still works.

Part of #3016

This contribution was developed with AI assistance (Claude Code).

Add @deprecated JSDoc tag and runtime console.warn when inputRef
is used. Users should migrate to the ref prop (via forwardRef)
which was added in trussworks#3011.

Part of trussworks#3016

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@mvanhorn mvanhorn requested a review from a team as a code owner March 23, 2026 05:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant