Skip to content

Commit

Permalink
tidy up example
Browse files Browse the repository at this point in the history
  • Loading branch information
joshfarrant committed Nov 26, 2024
1 parent 885955c commit 704b30a
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions apps/docs/content/components/FormControl.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ Try changing the input value to `monalisa` and submitting the form to show the `

```javascript live noinline
const App = () => {
const usernameInputRef = React.useRef(null)
const inputRef = React.useRef(null)
const [value, setValue] = React.useState('mona lisa')
const [isValid, setIsValid] = React.useState(false)

Expand All @@ -248,7 +248,7 @@ const App = () => {
setIsValid(valid)

if (!valid) {
usernameInputRef.current.focus()
inputRef.current.focus()
}
}

Expand All @@ -258,8 +258,7 @@ const App = () => {
<FormControl validationStatus={isValid ? 'success' : 'error'} fullWidth>
<FormControl.Label>GitHub handle</FormControl.Label>
<TextInput
name="username"
ref={usernameInputRef}
ref={inputRef}
fullWidth
value={value}
onChange={onChange}
Expand Down

0 comments on commit 704b30a

Please sign in to comment.