Move type-only imports (w/ verbatimModuleSyntax) (#746)

This commit is contained in:
Jaco
2023-04-02 11:51:38 +03:00
committed by GitHub
parent f36a80ad8b
commit b83073f588
12 changed files with 63 additions and 63 deletions
+16
View File
@@ -0,0 +1,16 @@
// Copyright 2017-2023 @polkadot/react-identicon authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { StyledInterface } from 'styled-components';
import styledComponents from 'styled-components';
// In styled-components v6, there is a named export which can be used
// directly, i.e. "import { styled } from ..." with no more magic. Until
// such time the cjs vs esm import here is problematic, so we hack around
// the various shapes below
export const styled = (
(styledComponents as unknown as { styled: StyledInterface }).styled ||
(styledComponents as unknown as { default: StyledInterface }).default ||
styledComponents as unknown as StyledInterface
);