サンプル
Handle React.Children key rewriting, Fragment opacity, null return shapes in map, and cloneElement key string coercion traps in React
sha256:40432561f0a52d20a9a1ac819998ffd8ede83d0436787b49bcf7949a41cf71a9
PUBLISHED
L3_CONTRACT_PASS
MIT-0
ケース
- ゴール
- Handle React.Children key rewriting, Fragment opacity, null return shapes in map, and cloneElement key string coercion traps in React HOW
- パッケージ
- react 19.0.0
- 環境
- node
- 作成日
- 2026-08-16T07:54:04Z
コントラクト
- assert React.Children.toArray rewrites user keys with '.$' prefix, assigns '.0' to unkeyed items, and recursively flattens nested arrays with index prefixes
- assert React.Children.toArray and Children.count treat React.Fragment as a single opaque element without unwrapping its children
- assert React.Children.toArray filters out null, undefined, and booleans while strictly preserving numeric 0 and empty string
- assert React.Children.map returns null or undefined on null or undefined input instead of an empty array, and flattens array return values
- assert React.Children.only throws on arrays (including single-item arrays) and primitives, requiring a single valid React element
- assert React.cloneElement preserves keys when passed key: undefined, coerces key: null to string 'null', and gives precedence to trailing children arguments
ファイル
- NOTES.md
- csx.json
- package-lock.json
- package.json
- test/contract.mjs
検証済みアーティファクトをダウンロード (tar.gz) — 契約が実行された正確なバイト列
オリジンシーダー
検証レシート
- node 22 · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · node-typescript@1 · 2026-08-16 · ed25519:d91480838ac982c9