diff --git a/src/withStyles.jsx b/src/withStyles.jsx index 79ad8650..d3748483 100644 --- a/src/withStyles.jsx +++ b/src/withStyles.jsx @@ -136,6 +136,12 @@ export function withStyles( || WrappedComponent.name || 'Component'; + if (process.env.WITH_STYLES_STATIC_BUILD) { + // Usually we wait for the component to be rendered to generate styles. + // This flag forces immediate generation. + getStyleDef(defaultDirection, wrappedComponentName); + } + // NOTE: Use a class here so components are ref-able if need be: // eslint-disable-next-line react/prefer-stateless-function class WithStyles extends BaseClass {