-
Notifications
You must be signed in to change notification settings - Fork 276
IntelliSense for StyleSheet #306
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
This is an issue with the types defined in the DefinitelyTyped repo (e.g. for the above see https://github.com/DefinitelyTyped/DefinitelyTyped/blob/types-2.0/react-native/index.d.ts#L3535 ). If someone wants to contribute better type definitions, that'd be awesome. |
@dev-xdyang, @billti, a830751 should fix the problem with autocompleting properties. As for 2 and 3 - the first is still a problem, even with the changes from a830751 It looks for me like a typescript issue, very similar to microsoft/TypeScript#11331 The second one probably has nothing to do with this extension - this is how VSCode displays a hint for function parameters. Hitting |
@MSLaguana, this should have been resolved by #306. Can we close this? |
@dev-xdyang We have updated the typings we use now as @vladimir-kotikov mentions, so it should be fixed. If you still have problems, feel free to re-open. |
Hi @josemigallas extension isn't responsible for intelisense for React native anymore, I believe you better address this to vscode repo as now it manages typings stuff. |
I create a function to fix this problem temporarily import { ViewStyle, TextStyle, ImageStyle } from 'react-native'
/**
* Quick Style
*
* related issue
* @see https://github.com/Microsoft/vscode-react-native/issues/306
* @see https://github.com/Microsoft/TypeScript/issues/29180
* @see https://github.com/Microsoft/TypeScript/issues/28470
*
* Marco? `$`
* @see https://github.com/Microsoft/TypeScript/issues/4892
*
* @todo `ViewStyle | TextStyle | ImageStyle` no work
* */
type _QS = ViewStyle & TextStyle & ImageStyle
export function $(style: _QS) {
return style
} usage const styles = StyleSheet.create({
item: $({
position: 'relative',
overflow: 'visible',
}),
}) And it works 😂 |
Has this issue been fixed? Even with the fix from @HaloWang I still don't get intellisense suggestions after the first line. |
Same issue here. Ended up finding this extension which helps. |
same issue. |
Actual Behavior
Expected Behavior
Software versions
The text was updated successfully, but these errors were encountered: