rescript-vscode icon indicating copy to clipboard operation
rescript-vscode copied to clipboard

jsx.componentWithProps - Goto Definition Issue

Open dkirchhof opened this issue 2 months ago • 1 comments

Hey,

I'm a fan of defining my (react) components with jsx.componentWithProps instead of using labeled arguments. Unfortunately I had to figure out, that the goto definition command doesn't work for these components.

Example:

// App.res

@jsx.component
let make = () => {
  <div>
    <SomeComponent test="" />
    <SomeComponent2 test="" />
  </div>
}
// SomeComponent.res

type props = {
  test: string
}

@jsx.componentWithProps
let make = props => {
  <div className=props.test></div>
}
// SomeComponent2.res

@jsx.component
let make = (~test: string) => {
  <div className=test></div>
}

While I can hover over <SomeComponent2... /> and use a short cut to go to the implementation / definition ("SomeComponent2.res"), it doesn't work on <SomeComponent .../>.

Hints for props will be shown in both cases.

Image

dkirchhof avatar Oct 13 '25 06:10 dkirchhof