GeekyAnts / GeekyAnts/NativeBase

Custom variants not working on Heading component

Open
#5,343 8 comments 0 reactions 1 assignee Claimed by @ankit-tailor 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

Custom variants extending the theme for the Heading component aren't working

### CodeSandbox/Snack link

https://snack.expo.dev/@smeads/nativebase-template

### Steps to reproduce

1. Try using the `variant` prop on the `Heading` component.
2. Using the `size` prop works as expected.

### NativeBase Version

3.4.15

### Platform

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

### Other Platform

React Native

### Additional Information

I'm experiencing an issue with extending the theme. Specifically, I've extended both the `Heading` and `Text` components with variants in the `components` config. When I use the `variant` prop for `Heading` the `variant` doesn't work, I only see default variants. However, It does work for `Text`. I'm also not getting type inference (TS) even though I have properly extended the ICustomTheme with my CustomThemeType. Again, type inference is working on Text.

Using the `size` prop does work, just to clarify.

I've tried to get the expo snack as closely to how I have it implemented. The snack experiences the same issue, so it is reproducible.

I apologize if I'm missing something but I've read through docs, looked over several other code examples and I'm not seeing where I'm messing things up. Any help with this issue would be appreciated. And, thank you for a great component library.

NativeBase Version - 3.4.15
React Native Version - 0.68.3

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.