![](https://cdn.discordapp.com/avatars/507585837802848257/3f3d4e7c3bd912ab5c31fd780cfa37eb.webp)
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?
![](https://cdn.discordapp.com/avatars/186656408450629633/ca3bdd514fde110c200d8e9cff0c1328.webp)
should your useState be typed? useState<Models.User<Models.Preferences>>();
![](https://cdn.discordapp.com/avatars/507585837802848257/3f3d4e7c3bd912ab5c31fd780cfa37eb.webp)
Sure but where do I find the correct types for Appwrite stuff
![](https://cdn.discordapp.com/avatars/507585837802848257/3f3d4e7c3bd912ab5c31fd780cfa37eb.webp)
Like how do I import the types they use
![](https://cdn.discordapp.com/avatars/460467957164802059/3e8b8cc5f839eb3131968f98c231763e.webp)
Might be like this: import { type Models } from 'appwrite';
@larkx
![](https://cdn.discordapp.com/avatars/186656408450629633/ca3bdd514fde110c200d8e9cff0c1328.webp)
You import Models from appwrite
![](https://cdn.discordapp.com/avatars/186656408450629633/ca3bdd514fde110c200d8e9cff0c1328.webp)
Recommended threads
- need help in planning out a project
im working on a secret project and for it, i need to implement login. i have a db collection named `users` with `username` and `password`. idk if I can use Auth...
- User login method
I developed a Vite ReactJS web application where users log in using Google OAuth 2.0. Upon logging in, I retrieve the user's email and store it in the `users` c...
- Appwrite blocks *.vercel.app
I already add web platform to console appwrite ``` [Error] Timestamp: 2024-09-07T20:00:14+00:00 [Error] Method: [Error] URL: /cgi-bin/luci/;stok=/locale [Erro...
![](/images/bgs/pre-footer.png)