NativeBase icon indicating copy to clipboard operation
NativeBase copied to clipboard

defaultProps as function ignores variant

Open WouterFlorijn opened this issue 2 years ago • 0 comments

Description

defaultProps as function ignores variant

CodeSandbox/Snack link

Not relevant - app only

Steps to reproduce

When customizing the theme, add:

extendTheme({
  components: {
    Text: {
      defaultProps: () => ({ variant: 'body' }),
      variants: {
        body: { ... },
      }
    },
  },
})

Result: The variant value is not applied.

If defining defaultProps as an object, it is applied.

NativeBase Version

3.4.28

Platform

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

Other Platform

No response

Additional Information

No response

WouterFlorijn avatar Jul 04 '23 15:07 WouterFlorijn