Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

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

Copy link
Copy link
@mjbvz

Description

@mjbvz
Issue body actions

From @mdo5004 on June 8, 2018 14:47

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

Copied from original issue: microsoft/vscode#51459

Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptA bug in TypeScriptFixedA PR has been merged for this issueA PR has been merged for this issue

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.