A question I recently got on YouTube: "Is recoil overkill for small apps? If so, what would you suggest otherwise?"
My answer: @recoiljs's API is very simple. So there isn't a massive set up cost to it. I think that makes it a great candidate for small projects. However...
My answer: @recoiljs's API is very simple. So there isn't a massive set up cost to it. I think that makes it a great candidate for small projects. However...
1/ I wouldn't use it for the sake of using it. Meaning I'd start by trying to get by with just passing state using props and React context, then using something like Recoil if you need to share state between components that are far away from each other in the component tree.
2/ Also, I wouldn't use it if the shape of the data you're working with locally is near 1-to-1 with some response from an API. Use something like React Query, SWR, @apollographql, or Relay for that.
3/ Finally - it's experimental. So only use it right now if you're comfortable with using an early-stage library with potentially breaking changes across versions.
What's your take? Let me know!
What's your take? Let me know!