Skip to content
This repository was archived by the owner on Apr 8, 2020. It is now read-only.
This repository was archived by the owner on Apr 8, 2020. It is now read-only.

Using asp-prerender-module with Office 365 Fabric and React #711

Description

@wiredprairie

I'm trying to use server-side prerendering with Office 365 Fabric components.

I'm not sure what the best way to handle their method of injecting styles would be.

import { configureLoadStyles } from '@microsoft/load-themed-styles';

// Store registered styles in a variable used later for injection.
let _allStyles = '';

// Push styles into variables for injecting later.
configureLoadStyles((styles: string) => {
  _allStyles += styles;
});

The _allStyles must be injected into a style tag:

<style>${ _allStyles}</style>

Should I create another asp-prerender-module to be included in _Layout.cshtml, or is there a more elegant (and possibly more efficient) method for doing this style/string injection?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions