T
TanStack•3y ago
stormy-gold

file structure

hello i wanted to know opinionated file structures for RQ im a rtk query users wanted to jump in RQ but i want to know before a good structuring that can scale if you have repos,blogs, or just your opinions about it i would love that
2 Replies
wise-white
wise-white•3y ago
Hi 👋 I like to use:
src/hooks
/queries
/mutations
src/hooks
/queries
/mutations
realistic-cyan
realistic-cyan•3y ago
I tend to match whatever the project structure is. If it's a "feature" based project then i colocate with the feature
src/
- /auth
- use-auth.ts
- /todos
- queries.ts
- mutations.ts
src/
- /auth
- use-auth.ts
- /todos
- queries.ts
- mutations.ts
or if the project is organized by "type" i follow @Louis comment above

Did you find this page helpful?