GeekyAnts/NativeBase

defaultProps as function ignores variant

WouterFlorijn opened this issue · 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

  • Android
  • CRA
  • Expo
  • iOS
  • Next

Other Platform

No response

Additional Information

No response