Skip to content

VSCode thinks there are 2 definitions of a React Component #51459

Closed

Description

VSCode thinks there are 2 definitions of a React Component

This issue was brought up recently but without sufficient info. Here is a minimal reproduction example:

  • VSCode Version: 1.24.0
  • OS Version: MacOS High Sierra 10.13.4 (17E202)

Steps to Reproduce:

  1. Create a React app
$ create-react-app my-bug-example
$ code my-bug-example
  1. Change src/App.js to
import React, { Component } from 'react';

class App extends Component {
  render() {
    return (
      <div className="App">
      <MyComponent />
      </div>
    );
  }
}

export default App;

class MyComponent extends Component {
  render(){
    return <MySingleComponent text="Instance 1" />
  }
}

class MySingleComponent extends Component {
  render(){
    return <p>{text}</p>
  }
}

  1. CMD + hover on <MySingleComponent text="Instance 1" />

screen shot 2018-06-08 at 10 33 09 am

  1. CMD + click on <MySingleComponent text="Instance 1" />

screen shot 2018-06-08 at 10 33 26 am

Does this issue occur when all extensions are disabled?: Yes

Activity

  1. vscodebot commented on Jun 8, 2018

    @vscodebot

    (Experimental duplicate detection)
    Thanks for submitting this issue. Please also check if it is already covered by an existing one, like:

  2. mjbvz commented on Jun 8, 2018

    @mjbvz
    Contributor

    This issue was moved to microsoft/TypeScript#24809

  3. added this to the July 2018 milestone on Jul 3, 2018
  4. added
    upstreamIssue identified as 'upstream' component related (exists outside of VS Code)
    on Jul 3, 2018
  5. locked and limited conversation to collaborators on Jul 23, 2018
  6. added
    bugIssue identified by VS Code Team member as probable bug
    on Jul 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugIssue identified by VS Code Team member as probable bugupstreamIssue identified as 'upstream' component related (exists outside of VS Code)verifiedVerification succeeded

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions