larkxOriginal post
Rank 2: Process
Hello, ESLint is flagging my code for assigning the user object (returned from account.get()) to a react state which is initially defined with the value "null"
const [user, setUser] = useState(null)
How do I fix this error?
Summary
- Developer asking for help importing types from Appwrite
- Recommending checking the documentation for the correct types
- Question about typing useState with `Models.User<Models.Preferences>`
- ESLint error flagged when assigning user object to react state initially set as "null"
- Suggested solution: Specify the type in useState like `useState<Models.User<Models.Preferences>>(null)`