How to embed sanity studio in React.js with custom theme from themer #6375
Unanswered
arsicdejan
asked this question in
Sanity Studio Support
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
How to embed sanity studio in React.js with custom theme from themer without including theme.js file in my project?
`import { visionTool } from '@sanity/vision';
import { Studio, defineConfig } from 'sanity';
import { structureTool } from 'sanity/structure';
import { schemaTypes } from './schemaTypes';
import { theme } from './theme';
const _config = defineConfig({
plugins: [structureTool(), visionTool()],
name: 'default',
projectId: 'myprojectid',
dataset: 'production',
theme: {},
root: false,
schema: {
types: schemaTypes,
},
});
const CMSStudioPage = () => {
return <Studio config={{ ..._config, theme }} scheme="light" basePath="/structure" />;
};
export default CMSStudioPage;
`
This is a page component where I want to render sanity studio. Is this even a right way to embed studio in react?
Any help would be greatly appreciated. Thank you!
Beta Was this translation helpful? Give feedback.
All reactions