From 4542fc45ea78eb38353654fa3a71d880400a8c12 Mon Sep 17 00:00:00 2001 From: Stoney Shou Date: Thu, 1 Feb 2024 16:20:47 +1100 Subject: [PATCH] Wrong type code in React example code --- docs/guide/framework-examples/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/guide/framework-examples/README.md b/docs/guide/framework-examples/README.md index 3772810e..89dc1163 100644 --- a/docs/guide/framework-examples/README.md +++ b/docs/guide/framework-examples/README.md @@ -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(null) // NOTE: useDeferredValue is React v18 only, for v17 or lower use debouncing const deferredPassword = useDeferredValue(password) @@ -223,7 +223,7 @@ const usePasswordStrength = (password: string) => { } export default function PasswordStrength() { - const [password, setPassword] = useState < string > '' + const [password, setPassword] = useState('') const result = usePasswordStrength(password) return (