Skip to content
This repository was archived by the owner on Oct 16, 2020. It is now read-only.

Cannot locate component (goto definition) in a React project #570

Open
carlbolduc opened this issue Mar 26, 2019 · 1 comment
Open

Cannot locate component (goto definition) in a React project #570

carlbolduc opened this issue Mar 26, 2019 · 1 comment

Comments

@carlbolduc
Copy link

With the following code:

import React from "react";
import OtherComponent from "./OtherComponent";

const MainComponent = props => {
  return (
    <tr>
      <td>{props.item.date}</td>
      <td>{props.item.description}</td>
      <td style={{ textAlign: "center" }}>
        <OtherComponent onClick={() => props.doStuff()} />
      </td>
    </tr>
  );
};

export default MainComponent;

Calling xref-find-definitions using M-. (goto definition) in Emacs will go to the second line of the file (import OtherComponent from "./OtherComponent";) instead of actually going to the file where OtherComponent is defined.

Trying the same thing with typescript-language-server will go to the file where OtherComponent is defined.

More details about this issue can be found here:
joaotavora/eglot#243

@GertBurger
Copy link

Experiencing the same issue via https://github.com/autozimu/LanguageClient-neovim

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants