GeekyAnts / GeekyAnts/NativeBase

Circular reference error when using ComponentTheme or StyledProps types

Open
#5,673 0 comments 1 reaction 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

Circular reference error when using ComponentTheme or StyledProps types

### CodeSandbox/Snack link

https://codesandbox.io/s/naughty-brown-0vyotf?file=/src/theme/index.tsx

### Steps to reproduce

Copy and paste this:

```
const ButtonComponentTheme: ComponentTheme = { baseStyle: { color: "white" } };

const theme = extendTheme({
components: {
Button: ButtonComponentTheme
},
config: {
// Changing initialColorMode to 'dark'
initialColorMode: "dark"
}
});

export type ITheme = typeof theme;
```

### NativeBase Version

3.4.22

### Platform

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

### Other Platform

_No response_

### Additional Information

_No response_

Contributor guide

Open the contributing guide

Research direction

Start with the reproduction in the CodeSandbox, especially src/theme/index.tsx, and confirm the circular reference error using the shown ComponentTheme and StyledProps types. Then locate the declarations for those types and extendTheme in the NativeBase TypeScript sources. Done means the reproduction no longer reports the circular reference while retaining the shown theme typing.

Written by the indexing model from the issue text.

Assessment

Tech stack
react-native, typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.