mirror of
https://github.com/owncast/owncast.git
synced 2024-10-10 19:16:02 +00:00
modify styleprovider so its cache can be safely removed on load
This commit is contained in:
parent
4cc5a6c26c
commit
322c118cfe
@ -34,7 +34,6 @@ const Doc = () => (
|
||||
</Html>
|
||||
);
|
||||
|
||||
|
||||
/*
|
||||
|
||||
Yoinked from https://ant.design/docs/react/use-with-next#using-pages-router. Change if someone figures out a way to
|
||||
@ -47,7 +46,8 @@ Doc.getInitialProps = async (ctx: DocumentContext) => {
|
||||
ctx.renderPage = () =>
|
||||
originalRenderPage({
|
||||
enhanceApp: App => props => (
|
||||
<StyleProvider cache={cache}>
|
||||
// layer forces antd to generate new css so that the cache can be safely removed
|
||||
<StyleProvider cache={cache} layer autoClear>
|
||||
<App {...props} />
|
||||
</StyleProvider>
|
||||
),
|
||||
@ -60,7 +60,7 @@ Doc.getInitialProps = async (ctx: DocumentContext) => {
|
||||
styles: (
|
||||
<>
|
||||
{initialProps.styles}
|
||||
<style dangerouslySetInnerHTML={{ __html: style }} />
|
||||
<style id="antd-init-cache" dangerouslySetInnerHTML={{ __html: style }} />
|
||||
</>
|
||||
),
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user