DEV Community

Discussion on: Recoil with React and TypeScript

Collapse
 
jaygcoder2020 profile image
Jay G

Thanks for the tutorial on this mate. Just commenting on the atom constructor. I've recently learned that you can cast the function call so you don't need to use the as operator. Something like this:

const todosState = atom<Todo[]>({
  key: "your-key",
  default: []
})
Enter fullscreen mode Exit fullscreen mode

Other than that, this is great content. Much appreciated!

Collapse
 
sirwanafifi profile image
Sirwan Afifi

Thank you for pointing it out. :) I am glad to know you enjoyed the content.