gluestack-ui icon indicating copy to clipboard operation
gluestack-ui copied to clipboard

type error on ejected components

Open macrozone opened this issue 1 year ago • 1 comments

Description

ejected components show type error "Type 'string' is not assignable to type 'AnimatableNumericValue | undefined'."

CodeSandbox/Snack link

No response

Steps to reproduce

  1. create a new project using @gluestack/themed
  2. eject https://gluestack.io/ui/docs/theme-configuration/customizing-theme/eject-library
  3. look at your ejected components. you see type errors. For example button:
Bildschirmfoto 2024-03-07 um 12 06 56

gluestack-ui Version

"@gluestack-ui/themed": "1.1.9",

Platform

  • [X] Expo
  • [ ] React Native CLI
  • [X] Next
  • [X] Web
  • [ ] Android
  • [ ] iOS

Other Platform

No response

Additional Information

No response

macrozone avatar Mar 07 '24 11:03 macrozone

as a partial fix, i added this to the generated gluestack-ui.config.ts:

type Config = typeof config;

declare module "@gluestack-style/react" {
  interface ICustomConfig extends Config {}
}

in some cases this does not work, e.g. the LinearGradient somehow has no colors property

macrozone avatar Mar 08 '24 10:03 macrozone