Skip to content
This repository was archived by the owner on Apr 24, 2021. It is now read-only.
This repository was archived by the owner on Apr 24, 2021. It is now read-only.

Can't trigger type hint for labeled arguments in React components #63

@ryyppy

Description

@ryyppy

Given following snippet:

module Test = {
  @react.component
  let make = (~name) => {
    let inputRef = React.useRef(Js.Nullable.null)

    <div>
      <input ref={ReactDOM.Ref.domRef(inputRef)} /> <button> {React.string("Click me " ++ name)} </button>
    </div>
  }
}

positioning the cursor on ~name shows me Js.t<'a> => 'a, which makes sense because there's the react ppx doing it's magic underneath. Not sure if this is fixable?

In this example, triggering on ~name will show no type hint at all:

@react.component
  let make = (~name: string) => { ... }

Expected:

In both examples, triggering a type hint for ~name should show me the right string type.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions