Wrapping ReactSelect styles into CacheProvider (#2365)

* Wrap app into emotion CacheProvider to isolate styles

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>

* Fix CacheProvider key

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>

* Moving CacheProvider into more specific components

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>

* Align @emotion/react & @emotion/cache version with ones inside react-select

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>

* Covering more components with CacheProvider

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>

* Changing emotion versions a bit more

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>

* Moving CacheProvider into bootstrap

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>

* Updating react-select types

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>

* A bit of cleaning up types

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>

* Specifying types a bit more

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>

* Fix gradients in namespace selector

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>

* Importing types separately

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>

* Using generic NonceProvider in bootstrap

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
This commit is contained in:
Alex Andreev authored and GitHub committed 2021-03-30 12:05:41 +03:00
1 parent 498c7defe9
commit 69200b50c7
8 files changed
+149 -165

No files matched your search

+7 -1
View File
@@ -19,6 +19,7 @@ import { filesystemProvisionerStore } from "../main/extension-filesystem";
import { App } from "./components/app";
import { LensApp } from "./lens-app";
import { themeStore } from "./theme.store";
import { NonceProvider as StyleCache } from "react-select";
/**
* If this is a development buid, wait a second to attach
@@ -80,9 +81,14 @@ export async function bootstrap(App: AppComponent) {
window.location.href = "about:blank";
}
});
const cacheProps = { nonce: "lens", cacheKey: "lens" };
render(<>
{isMac && <div id="draggable-top" />}
<App />
<StyleCache {...cacheProps}>
<App />
</StyleCache>
</>, rootElem);
}