gluestack / gluestack-ui

React & React Native Components & Patterns (copy-paste components & patterns crafted with Tailwind CSS (NativeWind))
https://gluestack.io/
MIT License
2.6k stars 118 forks source link

type error on ejected components #1913

Open macrozone opened 7 months ago

macrozone commented 7 months ago

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:
  4. Bildschirmfoto 2024-03-07 um 12 06 56

gluestack-ui Version

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

Platform

Other Platform

No response

Additional Information

No response

macrozone commented 7 months ago

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