Children's key is missing

未关闭
#301 4 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

@DanielHara 已经在做这个了。

开始于 2024年1月30日。

  • #841 来自 @DanielHara —— 未关闭

评估

难度
3/5
预计耗时
1-2 天
新手友好度
35/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
javascript, react
领域
frontend

调研方向

复现提供的 ReactElement-to-JSX 示例,并跟踪子 React 元素是如何被序列化的;该 issue 未指出应从哪个源文件或测试开始。完成的标准是:生成的 JSX 在 RadioButton 上包含 key="1-1-0",同时保留所示的 props 和父元素的 key。

由索引模型根据 Issue 内容生成。

描述

bug unconfirmed

Issue: There is something wrong with children's key.
Example: The expected output should be

<RowItem key="1-1">
    <RadioButton 
        key="1-1-0" 
        checked={false} 
        disabled={false} 
        label="auto" 
        name="1-1" 
        tabIndex="0"
    />
</RowItem>

But I got an output without RadioButton's key:

<RowItem key="1-1">
    <RadioButton 
        checked={false} 
        disabled={false} 
        label="auto" 
        name="1-1" 
        tabIndex="0"
    />
</RowItem>

I am sure the radio button element is correct:

      { '$$typeof': Symbol(react.element),
        type: [Function: RadioButton],
        key: '1-1-0',
        ref: null,
        props: 
         { label: 'auto',
           tabIndex: '0',
           disabled: false,
           checked: false,
           name: '1-1' },
        _owner: null,
        _store: {} }

Any suggestions about this?

主要语言
TypeScript
星标
519
派生
88
平均合并
3 小时 55 分钟
30 天内合并 PR
1

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

algolia/react-element-to-jsx-string 的其他 Issue

查看 algolia/react-element-to-jsx-string 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。