GeekyAnts / NativeBase

Mobile-first, accessible components for React Native & Web to build consistent UI across Android, iOS and Web.

Home Page:https://nativebase.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

defaultProps as function ignores variant

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