Use .js imports in src (#727)

* Use .js in src imports

* Bump dev
This commit is contained in:
Jaco
2023-03-09 10:43:31 +02:00
committed by GitHub
parent 2e99e0154f
commit 0e0de28da4
82 changed files with 236 additions and 236 deletions
+5 -5
View File
@@ -3,18 +3,18 @@
import React, { useCallback, useMemo } from 'react';
import Reader from 'react-qr-reader';
import styledComponents from 'styled-components';
import styledComponents, { StyledInterface } from 'styled-components';
import { createImgSize } from './util';
import { createImgSize } from './util.js';
// 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
const styled = (
(styledComponents as unknown as { styled: typeof styledComponents }).styled ||
(styledComponents as unknown as { default: typeof styledComponents }).default ||
styledComponents
(styledComponents as unknown as { styled: StyledInterface }).styled ||
(styledComponents as unknown as { default: StyledInterface }).default ||
styledComponents as unknown as StyledInterface
);
interface Props {