NativeBase icon indicating copy to clipboard operation
NativeBase copied to clipboard

TypeScript for Input stops working after adding baseStyle to it in extendTheme

Open bao-multiIT opened this issue 3 years ago • 2 comments

Description

TypeScript for Input stops working after adding baseStyle to it in extendTheme.

CodeSandbox/Snack link

No need.

Steps to reproduce

  1. Add baseStyle to Input in extendTheme and declare type according to the documentation For example:
const theme = extendTheme({
  components: {
    Input: {
      baseStyle: props => {
        return {
          color: 'black'
        }
      }
    }
  }
})

type NativeBaseThemeType = typeof nativeBaseTheme

declare module 'native-base' {
  interface ICustomTheme extends NativeBaseThemeType {}
}
  1. Use an Input component and try prop suggestions

  2. See that there are no prop suggestions image

  3. If we go further into the TypeScript file of the Input component, we will see this error: image

NativeBase Version

3.4.25

Platform

  • [ ] Android
  • [ ] CRA
  • [ ] Expo
  • [ ] iOS
  • [ ] Next

Other Platform

Visual Studio Code

Additional Information

No response

  1. Use an Input component and try prop suggestions

  2. See that there are no prop suggestions image

  3. If we go further into the typescript of the Input component, we can see this error:

Type alias 'IInputProps' circularly references itself.ts(2456)

image

NativeBase Version

3.4.25

Platform

  • [ ] Android
  • [ ] CRA
  • [ ] Expo
  • [ ] iOS
  • [ ] Next

Other Platform

Visual Studio Code

Additional Information

No response

bao-multiIT avatar Dec 29 '22 08:12 bao-multiIT

Hey @bao-multiIT , Thanks for reporting this. We will look into it.

AshwiniKumar007 avatar Jan 02 '23 05:01 AshwiniKumar007

@AshwiniKumar007 Just wondering, have you guys looked into this at all? It's preventing us from upgrading to the latest version of NativeBase as we'd have to manually add types to all of our callback props throughout our codebase, which we would rather not do.

sasha-evidation avatar Jun 20 '23 19:06 sasha-evidation