Skip to content

[error] Server side rendering and browserless testing doc #17832

Answered by thekeviv
hadnet asked this question in General
Discussion options

You must be logged in to vote

Here's the full file I use:

import Document, {
  DocumentContext,
  Head,
  Html,
  Main,
  NextScript,
} from "next/document";
// Fluent UI React 8+
import { Stylesheet, InjectionMode, resetIds } from "@fluentui/react";
// Fluent UI React (Fabric) 7 or earlier
// import { Stylesheet, InjectionMode, resetIds } from 'office-ui-fabric-react/lib/Utilities';

// Do this in file scope to initialize the stylesheet before Fluent UI React components are imported.
const stylesheet = Stylesheet.getInstance();

// Set the config.
stylesheet.setConfig({
  injectionMode: InjectionMode.none,
  namespace: "server",
});

// Now set up the document, and just reset the stylesheet.
export default class MyDo…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by micahgodbolt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants