GeekyAnts / GeekyAnts/NativeBase

defaultProps as function ignores variant

Open
#5,763 0 comments 0 reactions 0 assignees View on GitHub
bug triage v3
Dominant language
TypeScript
Stars
20.4k
Forks
2.4k
PR merge metrics
No merged PRs in 30d

Description

### Description

defaultProps as function ignores variant

### CodeSandbox/Snack link

Not relevant - app only

### Steps to reproduce

When customizing the theme, add:

```ts
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_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.