Skip to content

Commit

Permalink
Wrong type code in React example code
Browse files Browse the repository at this point in the history
  • Loading branch information
bc-stoney committed Feb 1, 2024
1 parent 4633c79 commit 4542fc4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/guide/framework-examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ const customMatcher = {
const zxcvbn = new ZxcvbnFactory(options, customMatcher)

const usePasswordStrength = (password: string) => {
const [result, setResult] = (useState < ZxcvbnResult) | (null > null)
const [result, setResult] = useState<ZxcvbnResult | null>(null)
// NOTE: useDeferredValue is React v18 only, for v17 or lower use debouncing
const deferredPassword = useDeferredValue(password)

Expand All @@ -223,7 +223,7 @@ const usePasswordStrength = (password: string) => {
}

export default function PasswordStrength() {
const [password, setPassword] = useState < string > ''
const [password, setPassword] = useState<string>('')
const result = usePasswordStrength(password)
return (
<div>
Expand Down

0 comments on commit 4542fc4

Please sign in to comment.