Skip to content

Commit

Permalink
sebastian review
Browse files Browse the repository at this point in the history
  • Loading branch information
oliviertassinari committed Mar 25, 2019
1 parent e53e242 commit 09b0d72
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
2 changes: 0 additions & 2 deletions docs/src/pages/css-in-js/advanced/advanced.md
Original file line number Diff line number Diff line change
Expand Up @@ -249,8 +249,6 @@ export default App;

## Server-side rendering

Material-UI supports concurrent server-side rendering.

This example returns a string of html and inlines the critical css required right before it’s used:

```jsx
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import * as React from 'react';

class ServerStyleSheets {
collect(children: React.ReactNode, options?: object): any;
declare class ServerStyleSheets {
constructor(options?: object);
collect(children: React.ReactNode, options?: object): void;
toString(): string;
getStyleElement(props?: object): React.ReactElement;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/* eslint-disable react/no-danger */

import React from 'react';
import { SheetsRegistry } from 'jss';
import StylesProvider from '../StylesProvider';
Expand Down Expand Up @@ -32,13 +30,16 @@ class ServerStyleSheets {
}

getStyleElement(props) {
return (
<style
id="jss-server-side"
key="jss-server-side"
dangerouslySetInnerHTML={{ __html: this.toString() }}
{...props}
/>
return React.createElement(
'style',
Object.assign(
{
id: 'jss-server-side',
key: 'jss-server-side',
dangerouslySetInnerHTML: { __html: this.toString() },
},
props,
),
);
}
}
Expand Down
2 changes: 1 addition & 1 deletion packages/material-ui-styles/src/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ export { default as ServerStyleSheets } from './ServerStyleSheets';
export { default as styled } from './styled';
export { default as StylesProvider } from './StylesProvider';
export { default as ThemeProvider } from './ThemeProvider';
export { default as useTheme } from './useTheme';
export { default as useTheme } from '@material-ui/styles/useTheme';
export { default as withStyles, CSSProperties, StyleRules, WithStyles } from './withStyles';
export { default as withTheme, WithTheme, withThemeCreator } from './withTheme';

0 comments on commit 09b0d72

Please sign in to comment.