GeekyAnts / GeekyAnts/NativeBase

[Regression] `Button` `_text` property completely overrides `_text` property defined in the themed button component

Open
#5,436 3 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

The component's `_text` property should merge and override with the one defined in the theme rather than resetting it.

### CodeSandbox/Snack link

https://snack.expo.dev/@swiftwork/button-theme-override

### Steps to reproduce

1. Extend the `Button` component theme
```js
const theme = extendTheme({
components: {
Button: {
variants: {
outline: ({colorScheme}) => ({
_dark: { _text: { color: `${colorScheme}.200` } },
}),
},
},
},
config: {
initialColorMode: 'dark',
},
});
```
2. Set an unrelated property in the button's `_text` property
```jsx
Hello There!
```
3. Observe text color not being changed

### NativeBase Version

3.4

### Platform

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

### Other Platform

_No response_

### Additional Information

Discord discussion https://discord.com/channels/785491682719301643/1025200721072763042/1025396759041687662

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.