
Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag storeGood question - you definitely want to keep your React app and Sanity Studio separate to avoid the mess you experienced! The key is understanding that Sanity Studio is its own application, not something you install inside your React app.
Create a separate folder for your Sanity Studio. You have a few good options:
Keep them at the same level:
/portfolio # Your existing React app /portfolio-studio # Your new Sanity Studio
Navigate to your parent directory (outside of /portfolio) and run:
cd ..
sanity initWhen prompted for the output path, specify portfolio-studio or let it create a new folder.
Create a parent folder to contain both:
/my-portfolio-project /frontend # Move your React app here /studio # Your Sanity Studio
Then cd into /studio and run sanity init there.
The command you mentioned is still valid! You have two options:
Global installation:
npm install -g @sanity/cli
sanity initOr use npx (no global install needed):
npx sanity@latest initBoth methods are officially supported - choose whichever you prefer. The sanity init command will walk you through:
Once your Studio is in its own folder, you'll connect your React app to fetch content:
cd portfolio
npm install @sanity/clientThe Studio is just your content editing interface - it runs separately (usually at localhost:3333). Your React app fetches data from Sanity's Content Lake via API calls, so they don't need to be in the same folder at all.
This separation keeps everything clean: your React app stays focused on the frontend, and your Studio stays focused on content management.
Sanity is the developer-first content operating system that gives you complete control. Schema-as-code, GROQ queries, and real-time APIs mean no more workarounds or waiting for deployments. Free to start, scale as you grow.
Content operations
Content backend


The only platform powering content operations
By Industry


Tecovas strengthens their customer connections
Build and Share

Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag store