You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 8, 2020. It is now read-only.
Repository navigation
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
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?
Having a second asp-prerender-module tag, if that works for you, would be the simplest solution.
An alternative but more complex solution would be as follows: #607 The code there can receive back arbitrary data from the prerendering phase, which you can then inject into your view. Right now, this involves a bunch of nontrivial logic, but we are going to make a simpler API for doing it (which is what #607 is there to track).
Activity
SteveSandersonMS commentedon Mar 7, 2017
Having a second
asp-prerender-moduletag, if that works for you, would be the simplest solution.An alternative but more complex solution would be as follows: #607 The code there can receive back arbitrary data from the prerendering phase, which you can then inject into your view. Right now, this involves a bunch of nontrivial logic, but we are going to make a simpler API for doing it (which is what #607 is there to track).