Example in README cannot be compiled in TypeScript
还没有人认领这个 Issue。
评估
- 难度
- 1/5
- 预计耗时
- 1 小时以内
- 新手友好度
- 45/100
- Issue 类型
- 文档
- 描述清晰度
- 描述清楚
- 活跃度
- 停滞
- 技术栈
- react, typescript
调研方向
检查 README 中的 TypeScript 示例,并将其与 issue 中修正后的示例进行比较。使用 react-refetch 的 TypeScript 设置验证该示例,然后更新 README,使示例能够成功编译。
由索引模型根据 Issue 内容生成。
描述
Hi, I tried to compile the following example in 4.0.0-0 in TypeScript, which is in README, but I couldn't compile it.
import { connect, PromiseState } from "react-refetch";
interface Props {
fooFetch: PromiseState<{}>;
barFetch: PromiseState<{}>;
}
export default connect<{}, Props>(() => ({
fooFetch: {
url: `/foos/1`,
andThen: foo => ({
barFetch: `/bar-for-foos-by-id/1`
})
}
}))(() => {
return <a>a</a>;
});
I fixed it like the following it can be compiled.
import { connect, PromiseState } from "react-refetch";
interface Props {
fooFetch: PromiseState<{}>;
barFetch: PromiseState<{}>;
}
export default connect<{}, Props>(() => ({
fooFetch: {
url: `/foos/1`,
andThen: foo => ({
fooFetch: { value: foo },
barFetch: `/bar-for-foos-by-id/1`
})
},
barFetch: { value: null }
}))(() => {
return <a>a</a>;
});
- 主要语言
- JavaScript
- 星标
- 3.4k
- 派生
- 137
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
heroku/react-refetch 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 35/100
heroku/react-refetch#258 · 1 条评论 ·
-
难度 4/5 3-5 天 新手友好度 35/100
heroku/react-refetch#228 · 1 条评论 · 3 个 reaction ·
-
难度 4/5 3-5 天 新手友好度 35/100
heroku/react-refetch#227 · 2 条评论 ·
-
难度 2/5 1-3 小时 新手友好度 45/100
heroku/react-refetch#226 · 1 条评论 ·
-
难度 5/5 一周以上 新手友好度 25/100
heroku/react-refetch#218 · 5 条评论 · 8 个 reaction ·
查看 heroku/react-refetch 的全部 Issue
相似的 Issue
-
area:plugins enhancement platform:vscode
难度 2/5 1-3 小时 新手友好度 88/100
anthropics/claude-code#103166 ·
维护者通常 1 天内回复
-
check:failed logos:add
难度 1/5 1 小时以内 新手友好度 78/100
-
[workshop-sim] Improve: Add verifiable checkpoint and bridge to Step 5 (What Are Agentic Workflows?)未关闭feedback simulation workshop
难度 2/5 1-3 小时 新手友好度 88/100
githubnext/gh-aw-workshop#4715 ·
维护者通常 1 天内回复
-
getComputedStyle ignores a rule whose selector list contains a pseudo-element (regression in 30.x)可能已有人在做 @chiragjangiir 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 80/100
维护者通常 1 天内回复
-
external-plugin external-plugin-canvas needs-review:MEDIUM ready-for-review
难度 2/5 1-3 小时 新手友好度 68/100
github/awesome-copilot#5153 · 2 条评论 ·
维护者通常 1 天内回复