kadena-community/kadena.js

[@kadena/react-components] When bootstrapping the `react-components` the baseGlobalStyles produces a type error

Opened this issue · 1 comments

EnoF commented

Describe the bug
When bootstrapping the react-components the baseGlobalStyles produces a type error:

error| TS2345: Argument of type 'Record<string, unknown>' is not assignable to parameter of type '{ '@import'?: unknown; '@font-face'?: unknown; } & { [x: string]: CSS<{}, { colors: { background: "Gainsboro"; fontColor: "Gainsboro"; gray500: "DarkSlateGray"; blue500: "SteelBlue"; purple500: "RebeccaPurple"; green500: "DarkGreen"; red500: "DarkRed"; }; ... 6 more ...; sizes: { ...; }; }, DefaultThemeMap, { ...; }...'. Type 'Record<string, unknown>' is not assignable to type '{ [x: string]: CSS<{}, { colors: { background: "Gainsboro"; fontColor: "Gainsboro"; gray500: "DarkSlateGray"; blue500: "SteelBlue"; purple500: "RebeccaPurple"; green500: "DarkGreen"; red500: "DarkRed"; }; ... 6 more ...; sizes: { ...; }; }, DefaultThemeMap, { ...; }>; }'. 'string' index signatures are incompatible. Type 'unknown' is not assignable to type 'CSS<{}, { colors: { background: "Gainsboro"; fontColor: "Gainsboro"; gray500: "DarkSlateGray"; blue500: "SteelBlue"; purple500: "RebeccaPurple"; green500: "DarkGr

To Reproduce
When initializing the globalStyles and providing the baseGlobalStyles to globalCss we receive the above mentioned type error.

import "./globals.css";
import {
  getCssText,
  globalCss,
  baseGlobalStyles,
} from "@kadena/react-components";

const globalStyles = globalCss(baseGlobalStyles);

globalStyles();

Expected behavior
No type error

Desktop (please complete the following information):

  • OS: Linux
  • TSC: 4.9.5

This issue is stale because it is open for 60 days with no activity