Console ta dando esse erro e nao sei como resolver:
_emotion_styled__WEBPACK_IMPORTED_MODULE_0__.default)[tag] is not a function
at Typography (bundle.js:454:90)
at renderWithHooks (react-dom.development.js:16305:1)
at mountIndeterminateComponent (react-dom.development.js:20074:1)
at beginWork (react-dom.development.js:21587:1)
at HTMLUnknownElement.callCallback (react-dom.development.js:4164:1)
at Object.invokeGuardedCallbackDev (react-dom.development.js:4213:1)
at invokeGuardedCallback (react-dom.development.js:4277:1)
at beginWork$1 (react-dom.development.js:27451:1)
at performUnitOfWork (react-dom.development.js:26557:1)
at workLoopSync (react-dom.development.js:26466:1)
Meu codigo Typography.jsx
import styled from "@emotion/styled";
const components = {
h1: "h1",
body: "p",
};
const styles = {
h1: `
font-weight: 600;
font-size: 40px;
line-height: 49px;
`,
body: `
font-weight: 400;
font-size: 20px;
line-height: 24px;
`,
};
export const Typography = ({ variable, component, children }) => {
const tag = components[component];
const UsedComponents = styled[tag]`${styles[variable]}`;
return <UsedComponents>
{ children }
</UsedComponents>;
};