GeekyAnts / GeekyAnts/NativeBase

Factory - Typescript - Expression produces a union type that is too complex to represent. ts(2590)

Open
#5,429 1 comment 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

There seems to be an issues with typescript using a factory for a native base components in VSCode. The error is union type that is too complex. Snack link seesm to be ok, but as you can see, it not checking types correctly (see prop `unknownprop` not displaying as error)

### CodeSandbox/Snack link

https://snack.expo.dev/ANiYSN7p8?platform=web

### Steps to reproduce

1. Go to snack link
2. Click on download
3. Scroll down to load into VSCode or VsCodium
4. See error typescript about union types (but code works fine)

Screen Shot 2022-09-28 at 12 35 11

The snack for expo seems to not report typescript errors correctly, as you can see the unknown prop is not displaying correctly.

I have tried several ways with same issues:

Screen Shot 2022-09-28 at 12 36 17

Screen Shot 2022-09-28 at 12 36 46

It seems to work ok with native components:

Screen Shot 2022-09-28 at 12 36 54

### NativeBase Version

^3.4.17

### Platform

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

### Other Platform

VsCode

### Additional Information

N/a

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.