Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[docs] Fix Gatsby sample config in CSS variables #34024

Merged
merged 3 commits into from Aug 29, 2022
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -187,14 +187,18 @@ export default class MyDocument extends Document {

#### Gatsby

To use the API with a Gatsby project, add the following code to the custom [`gatsby-ssr.js`](https://www.gatsbyjs.com/docs/reference/config-files/gatsby-ssr/) file:
To use the API with a Gatsby project, add the following code to the custom [`gatsby-ssr.jsx`](https://www.gatsbyjs.com/docs/reference/config-files/gatsby-ssr/) file:
bicstone marked this conversation as resolved.
Show resolved Hide resolved

```jsx
import React from 'react';
import { getInitColorSchemeScript } from '@mui/material/styles';

export function onRenderBody({ setPreBodyComponents }) {
setPreBodyComponents([getInitColorSchemeScript()]);
setPreBodyComponents([
<React.Fragment key="mui-init-color-scheme-script">
{getInitColorSchemeScript()}
</React.Fragment>,
]);
}
```

Expand Down