Skip to content
This repository was archived by the owner on May 15, 2022. It is now read-only.

Commit 78f7917

Browse files
committed
Revert inlining styles in JS bundle, export external stylesheet to prevent FOUC
1 parent d05235f commit 78f7917

File tree

6 files changed

+302
-18
lines changed

6 files changed

+302
-18
lines changed

example/components/ReactDatGui.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import DatGui, {
99
DatSelect,
1010
DatString
1111
} from 'react-dat-gui';
12+
import 'react-dat-gui/dist/index.css';
1213
import Stats from './Stats';
1314

1415
/**

example/next.config.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
*
44
* @see https://nextjs.org/docs/#custom-configuration
55
*/
6-
module.exports = {
6+
const withCSS = require('@zeit/next-css');
7+
8+
module.exports = withCSS({
79
assetPrefix: process.env.NODE_ENV === 'production' ? '/react-dat-gui' : ''
8-
};
10+
});

example/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"not op_mini all"
1111
],
1212
"dependencies": {
13+
"@zeit/next-css": "^1.0.1",
1314
"next": "^9.0.5",
1415
"prop-types": "link:../node_modules/prop-types",
1516
"react": "link:../node_modules/react",

0 commit comments

Comments
 (0)