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.

Undefined variables inside React component callbacks have a wrong type #14

Closed
@bsansouci

Description

@bsansouci

It seems like if I have a callback in my react component, I can reference undefined variables without the extension seeing a problem and it even has a type:

Js.Fn.arity1<
  option<React.element> => unit
>
type arity1<'a> = {I1: 'a}

Screen Shot 2020-11-19 at 08 57 56

This react component is inline in a call to a arity1 function showModal(. <Component ... />) which might be relevant.
If I do the same in a more normal spot, at the bottom of my functional component, I get a similar behavior but with this type instead:

(
  string,
  ~props: option<ReactDOMRe.props>,
  array<React.element>
) => React.element

If I cmd+click it, it jumps to ReasonReact's createElement external function

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions