ReferenceError – any is not defined (React Js)

Getting error ReferenceError:
any is not defined
at line below –

const [userInfos, setUserInfos] = useState < any > [];

What am I doing wrong here?

Answer

You are using TypeScript in a JavaScript project.

The correct code: const [userInfos, setUserInfos] = useState([])