GeekyAnts / GeekyAnts/NativeBase

TypeScript for Input stops working after adding baseStyle to it in extendTheme

Open
#5,628 2 comments 3 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

TypeScript for Input stops working after adding baseStyle to it in extendTheme.

### CodeSandbox/Snack link

No need.

### Steps to reproduce

1. Add baseStyle to Input in extendTheme and declare type according to the documentation
For example:
```typescript
const theme = extendTheme({
components: {
Input: {
baseStyle: props => {
return {
color: 'black'
}
}
}
}
})

type NativeBaseThemeType = typeof nativeBaseTheme

declare module 'native-base' {
interface ICustomTheme extends NativeBaseThemeType {}
}
```
2. Use an Input component and try prop suggestions

4. See that there are no prop suggestions
![image](https://user-images.githubusercontent.com/120077006/209927686-17b9603a-1a3f-4f72-b8c1-2e7665264e7f.png)

5. If we go further into the TypeScript file of the Input component, we will see this error:
![image](https://user-images.githubusercontent.com/120077006/209928614-f2596f1b-42d8-4503-90e4-5dcee14a4469.png)

### NativeBase Version

3.4.25

### Platform

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

### Other Platform

Visual Studio Code

### Additional Information

_No response_

3. Use an Input component and try prop suggestions
4. See that there are no prop suggestions
![image](https://user-images.githubusercontent.com/120077006/209927686-17b9603a-1a3f-4f72-b8c1-2e7665264e7f.png)

6. If we go further into the typescript of the Input component, we can see this error:
```
Type alias 'IInputProps' circularly references itself.ts(2456)
```
![image](https://user-images.githubusercontent.com/120077006/209927824-dd2de54c-d87f-4def-a298-0d48e34bbbb1.png)

### NativeBase Version

3.4.25

### Platform

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

### Other Platform

Visual Studio Code

### 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.