Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

Implicit type conversion? #105

Open
Open
@ivan-demchenko

Description

@ivan-demchenko

Hello,
I’m exploring rescript-react and noticed a peculiar behaviour. Here’s my test code:

moduleMyComponent= {  @react.componentletmake= ()=> {let (value,setValue)=React.useState(_=>0)    <>      <div> {React.string(string_of_int(value))} </div>      <inputonChange={evt=> {letx=ReactEvent.Form.target(evt)["value"]// 1setValue(_=>x)// 2        }}      />    </>  }}

What I noticed is that on the line marked with// 1 the type ofx is'a, but on line// 2 hovering overx shows the typeint. Why is that? I would expect the compiler to ask me to decode the value ofx.

Thank you in advance!

P.S.

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


      [8]ページ先頭

      ©2009-2025 Movatter.jp