wix / react-native-ui-lib

UI Components Library for React Native
https://wix.github.io/react-native-ui-lib/
MIT License
6.53k stars 712 forks source link

VSCode not suggesting the component's props #2230

Closed thanhloc-17 closed 1 year ago

thanhloc-17 commented 2 years ago

This problem occur when I update new version or RNUILib, then I type some prop and VSCode not suggest any props

image

With the others package, the IntelliSense still working well.

Thanks

ramssutharr commented 2 years ago

having same issue on react native v0.70 .

qkudev commented 2 years ago

Me too!

thanhloc-17 commented 2 years ago

up

tarikfp commented 2 years ago

any news on this? @ethanshar

lakardion commented 2 years ago

Same on my side. I get key and ref as the only two available props It is happening on some imported (checked on Text and Image as of now) components from the library

import { Image } from 'react-native-ui-lib';

image

However if I import from:

import { Image } from 'react-native-ui-lib/src/components/image';

Props show up properly. So there must be something wrong with the way the components are being exported from some index

Using react-native-ui-lib v6.22.1 react-native v0.69.6

The-White-Fang commented 1 year ago

any updates or hints on what might be wrong?

The-White-Fang commented 1 year ago

possible duplicate of https://github.com/wix/react-native-ui-lib/issues/2202 ?

KishoreBarik commented 1 year ago

same issue here

thanhloc-17 commented 1 year ago

up

thanhloc-17 commented 1 year ago

up

chrismerino commented 1 year ago

Issue still persists on RN 0.70.5 and react-native-ui-lib: 7.1.0

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

ethanshar commented 1 year ago

Hi, is this issue still relevant? I don't experience it

henry-infevo commented 1 year ago

I still experience it on 7.3.5

henry-infevo commented 1 year ago
Screenshot 2023-05-14 at 11 45 32

It looks like the components is losing props type.

The-White-Fang commented 1 year ago

Hi, is this issue still relevant? I don't experience it

Could you share your tsconfig.json please? We may have to add something to it to make it work. Starting a new project from scratch and installing the lib doesn't work for us.

A workaround I found was to remove the global type ThemeComponent and place it in an export statement. But that seems like something that will never be in the official repo. I am still looking into it and will let you know if I can find something else to fix it.

Edit: I noticed that generated d.ts files don't have any reference to ThemeComponent. image

Maybe that is the problem here.

henry-infevo commented 1 year ago

my tsconfig below:

{
  "extends": "expo/tsconfig.base",
  "compilerOptions": {
    "strict": true,
    "baseUrl": ".",
    "typeRoots": ["./node_modules/@types", "./@types"]
  }
}

p.s: I defined global ThemeComponent but it doesn't work.

The-White-Fang commented 1 year ago

Hi, is this issue still relevant? I don't experience it

Could you share your tsconfig.json please? We may have to add something to it to make it work. Starting a new project from scratch and installing the lib doesn't work for us.

A workaround I found was to remove the global type ThemeComponent and place it in an export statement. But that seems like something that will never be in the official repo. I am still looking into it and will let you know if I can find something else to fix it.

Edit: I noticed that generated d.ts files don't have any reference to ThemeComponent. image

Maybe that is the problem here.

I was right, it turns out that if you define your types in d.ts files, they will be excluded from your build. The solution to this would be to move the global types to imported types.

M-i-k-e-l commented 1 year ago

Should be fixed with the above PR

Revolt9k commented 1 year ago

Any news? Still experience it on 7.6.0

vicdelfant commented 1 year ago

a885dfdb675025fd03d47119834f649462e056a4 was from Jul 24, 2023 and 7.6.0 is from before (July 20th), so we're still waiting for a new release.

ethanshar commented 1 year ago

Should be fixed in version 7.7.0 that should be released next week