DEV Community

Discussion on: Recoil with React and TypeScript

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!

sirwanafifi profile image
Sirwan Afifi Author

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