vitalets / react-native-extended-stylesheet

Extended StyleSheets for React Native
MIT License
2.93k stars 132 forks source link

types missing? #133

Open nicolasburtey opened 4 years ago

nicolasburtey commented 4 years ago

I'm losing types suggestion from Visual Studio Code if I use EStyleSheet. Do I need to install anything beyond "react-native-extended-stylesheet" to get the types as I have them with StyleSheet?

Environment

System: OS: macOS 10.15.3 CPU: (8) x64 Intel(R) Core(TM) i5-8259U CPU @ 2.30GHz Memory: 273.95 MB / 16.00 GB Shell: 5.0.16 - /usr/local/bin/bash Binaries: Node: 10.16.3 - ~/.nvm/versions/node/v10.16.3/bin/node Yarn: 1.22.4 - /usr/local/bin/yarn npm: 6.13.1 - ~/.nvm/versions/node/v10.16.3/bin/npm Watchman: 4.9.0 - /usr/local/bin/watchman SDKs: iOS SDK: Platforms: iOS 13.4, DriverKit 19.0, macOS 10.15, tvOS 13.4, watchOS 6.2 IDEs: Android Studio: 3.5 AI-191.8026.42.35.5791312 Xcode: 11.4.1/11E503a - /usr/bin/xcodebuild npmPackages: react: 16.13.1 => 16.13.1 react-native: 0.61.5 => 0.61.5

vitalets commented 4 years ago

Do I need to install anything beyond "react-native-extended-stylesheet" to get the types as I have them with StyleSheet?

No. Types are included in index.d.ts. Could you check with some other package having types in index.d.ts?

nexorianus commented 4 years ago

can confirm this in Visual Studio Code. React.StyleSheet.create():
image EStyleSheet.create(): image

The problem is, that you define the properties of the create object as

type AnyObject = {[key: string]: any};

(this plugin v0.12.0) i guess, this should rather expand the React.StyleSheet types:

type NamedStyles<T> = { [P in keyof T]: ViewStyle | TextStyle | ImageStyle };

(rn v0.60.31)

btw. i guess its a duplicate of #118

stale[bot] commented 4 years ago

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?

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

nexorianus commented 4 years ago

this is not solved in behalf of the opening post.

stale[bot] commented 4 years ago

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?

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

nexorianus commented 4 years ago

push

stale[bot] commented 3 years ago

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?

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

erzzo commented 2 years ago

I'm experiencing the same issue