Just watched "React Query API Design: Lessons Learned" by @TkDodo 7 insights: 1


Just watched "React Query API Design: Lessons Learned" by @TkDodo

7 insights:

1. Don't be excited about major versions - they're *breaking*.

2. Design with types in mind. If it's hard to type, it's likely hard for the user to understand too.

3. Take time with your demands - sometimes the first try is wrong.

4. Consider inverting control in APIs so the consumer has the power.

5. Be pragmatic. For example, react-query returns errors as type "Error" instead of undefined by default because that's most common.

6. Less is more. Keep the API lean. Some features are best handled outside the library.

7. You'll likely screw up the API. So, everyone, please try betas!
Full talk at React Paris: https://www.youtube.com/watch?v=l3PxErcKeAI&list=PL53Z0yyYnpWitP8Zv01TSEQmKLvuRh_Dj&index=21

View original on X