Implicit type conversion?
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 25/100
- issue の種類
- バグ
- 明瞭さ
- 説明が足りない
- 活発さ
- 停滞
- 技術スタック
- react
- 領域
- frontend
調査の方向性
提供されたコンポーネント内の ReactEvent.Form.target(evt)["value"] 式と useState セッターから始め、リンク先の Playground を使って動作を再現します。結果をリンク先のフォーラムスレッドと比較し、推論された型が意図的なものかどうかを判断します。動作が明確になるか、リポジトリへの具体的な変更が特定できれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Hello,
I’m exploring rescript-react and noticed a peculiar behaviour. Here’s my test code:
module MyComponent = {
@react.component
let make = () => {
let (value, setValue) = React.useState(_ => 0)
<>
<div> {React.string(string_of_int(value))} </div>
<input
onChange={evt => {
let x = ReactEvent.Form.target(evt)["value"] // 1
setValue(_ => x) // 2
}}
/>
</>
}
}
What I noticed is that on the line marked with // 1 the type of x is 'a, but on line // 2 hovering over x shows the type int. Why is that? I would expect the compiler to ask me to decode the value of x.
Thank you in advance!
P.S.
- 主要言語
- ReScript
- スター
- 517
- フォーク
- 45
- PR マージ指標
- 30日以内にマージされた PR はありません
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
rescript-lang/rescript-react のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
rescript-lang/rescript-react#145 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 48/100
rescript-lang/rescript-react#152 · リアクション 3 件 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 45/100
rescript-lang/rescript-react#147 · コメント 2 件 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
rescript-lang/rescript-react#111 · コメント 3 件 ·
-
Scroll Restoration オープン
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
rescript-lang/rescript-react#104 · リアクション 1 件 ·
rescript-lang/rescript-react の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
zostera/django-bootstrap4#894 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 86/100
eknowledger/toolbench#101 · コメント 1 件 ·
-
comp/dashboard P3 type/bug
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
NousResearch/hermes-agent#117722 ·
-
clawsweeper:fix-shape-clear clawsweeper:queueable-fix clawsweeper:source-repro impact:ux-friction issue-rating: 🦞 diamond lobster no-stale P3
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100