Natural index numbers on callback function
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 30/100
- Issue 类型
- 功能
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- javascript, react
- 领域
- frontend
调研方向
首先检查 reactStringReplace 的入口点以及 issue 中显示的 callback 参数。跟踪匹配项的收集和索引方式,然后验证 callback 是否接收到可用于使用 nodes 数组替换匹配项的自然索引;如果 repository 提供了相关测试,请添加或更新这些测试。
由索引模型根据 Issue 内容生成。
描述
Hi there 👋
I have a situation where I'd like to replace the matched regex with my own array of nodes respectively. It would be great receiving natural index numbers 0, 1, 2 on callback instead of odd ones.
const nodes: React.ReactNodeArray
// [
// <span key='something'>label</span>,
// <h1 key='otherthing'>heading</h1>
// ]
reactStringReplace('These are my {} and {} and {} values.', /({})/g, (match, i) => {
// odd index numbers
return nodes[(i - 1) / 2]
})
- 主要语言
- JavaScript
- 星标
- 665
- 派生
- 54
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
iansinnott/react-string-replace 的其他 Issue
-
难度 4/5 3-5 天 新手友好度 35/100
-
难度 3/5 1-2 天 新手友好度 35/100
-
难度 3/5 1-2 天 新手友好度 35/100
iansinnott/react-string-replace#89 · 1 个 reaction ·
-
难度 2/5 1-3 小时 新手友好度 38/100
-
Capture groups?未关闭
难度 3/5 1-2 天 新手友好度 35/100
iansinnott/react-string-replace#58 · 4 条评论 · 15 个 reaction ·
查看 iansinnott/react-string-replace 的全部 Issue
相似的 Issue
-
external-issue to-triage
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 84/100
LearningCircuit/local-deep-research#7067 ·
维护者通常 1 天内回复
-
automated issue report
难度 1/5 1 小时以内 新手友好度 65/100
lirantal/discoprint#32 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 86/100
维护者通常 1 天内回复