You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[FEATURE] add previous state to useInputState transform function #553
Is your feature request related to a problem? Please describe.
Currently, the transform function in useInputState only receives the new input value. To preserve the current value when the input exceeds a length limit, the transform function needs to reference the hook’s return value. (example)
This would allow the transform function to reject an input change by returning previousValue, without referencing the hook’s own return value. Existing single argument transform functions would remain compatible.
Describe alternatives you've considered
If there’s a better approach, please let me know.
Additional context
A length limit is one example of an input rule that benefits from access to the previous state.
The same approach could support other validation rules that need to preserve the previous value when an input change is rejected.
If this proposal is accepted, could you assign this issue to me?
Activity
hyesungoh commentedon Oct 14, 2026
I think it's good! 👍 Can you do this?
Antoliny0919 commentedon Oct 14, 2026
I think my colleague will handle it @DongEun02 😁