Skip to content

How to use useState with TextField? #6104

Answered by reidbarber
mattbal asked this question in Q&A
Discussion options

You must be logged in to vote

You'll want to use B so that the value can propagate down to other subcomponents of TextField that might need to use it, like <FieldError /> for validation, and also receive accessibility features provided by useTextField.

Under the hood, passing it into TextField means it uses the useTextField hook, while just passing it to Input is similar to just using a native <input />.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@mattbal
Comment options

Answer selected by mattbal
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants