#root.tsx vs main.tsx

4 messages · Page 1 of 1 (latest)

rocky mural
#

How do I decide what to put in src/main.tsx vs src/routes/__root.tsx?
I am using Zustand, TS Query and Router, and ShadCN. I don't know where I should setup Zustand and TS Query or where I should put my sidebar.

runic kettle
#

Create your ts query and zustand providers and create them alongside the router in main or wherever you call createRouter

#

Your sidebar id image goes in root or a layout route