import React from 'react';
import Document, { Head, Main, NextScript } from 'next/document';

export default class BaseDocument extends Document {
    static async getInitialProps(ctx) {
        const initialProps = await Document.getInitialProps(ctx);

        return initialProps;
    }

    render() {
        // const { dir } = this.props;

        // console.log(this.props);

        return (
            <html lang="en">
                <Head>
                    <link
                        rel="stylesheet"
                        type="text/css"
                        href="/_next/static/style.css"
                    />
                </Head>
                <body>
                    <Main />
                    <NextScript />
                </body>
            </html>
        );
    }
}

import React from 'react';
import Document, { Head, Main, NextScript } from 'next/document';

export default class BaseDocument extends Document {
    static async getInitialProps(ctx) {
        const initialProps = await Document.getInitialProps(ctx);

        return initialProps;
    }

    render() {
        const isProduction = process.env.NODE_ENV === 'production';

        return (
            <html lang="en">
                <Head>
                    {isProduction && (
                        <link
                            rel="stylesheet"
                            type="text/css"
                            href="/_next/static/style.css"
                        />
                    )}
                </Head>
                <body>
                    <Main />
                    <NextScript />
                </body>
            </html>
        );
    }
}

Disable root style.css in non production environment
Disable root style.css in non production environment
