question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Visual Studio can't suggest my prop types

See original GitHub issue

Is this a bug report?

Yes

Did you try recovering your dependencies?

Yes

Which terms did you search for in User Guide?

Props, PropTypes, VS Code

Environment

VS Code: 1.33.1
System:
    OS: Windows 10 - 10.0.17763.437
    CPU: (4) x64 Intel(R) Core(TM) i5-7300HQ CPU @ 2.50GHz
  Binaries:
    Node: 10.13.0 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.15.2 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
    npm: 6.9.0 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Edge: 44.17763.1.0
    Internet Explorer: 11.0.17763.1
    I have Chrome and Firefox too
  npmPackages:
    react: ^16.8.6 => 16.8.6
    react-dom: ^16.8.6 => 16.8.6
    react-scripts: 3.0.0 => 3.0.0
  npmGlobalPackages:
    create-react-app: Not Found

Steps to Reproduce

jsconfig.json places in my global folder (not in src):

{
  "compilerOptions": {
    "jsx": "react",
    "baseUrl": "./src"
  }
}

I installed React PropTypes Intellisense extension into VS Code

  1. Write propTypes
  2. In your component, type this.props. and hit [Ctrl] + [Space] to show suggestions

Expected Behavior

My PropTypes should be in suggestion window

Actual Behavior

obraz It’s also didn’t work outside of component - I only have ref, children and key suggestions from React

Reproducible Demo

Not needed - it’s default CRA setup 3.0.0

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:14 (1 by maintainers)

github_iconTop GitHub Comments

github_iconTop Results From Across the Web

How to make vs code autocomplete React component's prop ...
P.S.: I'm using JS, not TS. reactjs · visual-studio-code · intellisense · jsx · javascript-intellisense.
Read more >
React PropTypes Intellisense - Visual Studio Marketplace
The extension finds React PropTypes and adds them to the suggestion list. ... It works for all implementations of the "PropTypes" feature, i.e. ......
Read more >
Using JSDoc to enable intellisense for render props in vscode
vscode uses typescript internally, and in most cases, it can automatically infer types from type-definitions, JSDoc comments or proptypes. For ...
Read more >
How to validate React props using PropTypes - LogRocket Blog
Learn how to validate props with React PropTypes, React's internal mechanism for adding type checking to component props.
Read more >
IntelliSense in Visual Studio - Microsoft Learn
A list of valid members from a type (or namespace) appears after you ... You can't use IntelliSense if the cursor is in...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found