wrong `composes` for propType objects that are wrapped
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 35/100
- Issue 类型
- 缺陷
- 描述清晰度
- 需要澄清
- 活跃度
- 停滞
- 技术栈
- javascript, react
调研方向
首先跟踪 react-docgen 如何从包装的 prop-type 表达式推导出 composes 数组,并使用 omit(OtherComponent.propTypes, ...) 示例进行复现。将预期的 important/path 结果与实际的 lodash/omit 结果进行比较,并确定应如何处理非首个复合参数。对于受支持的包装表达式情况,行为已定义并得到覆盖时,即视为完成。
由索引模型根据 Issue 内容生成。
描述
Hello!
when defining prop types people do all sorts of things, for example:
import omit from 'lodash/omit';
import OtherComponent from 'important/path';
export default class Component extends React.PureComponent {
propTypes = {
...omit(OtherComponent.propTypes, ['exclude', 'us']),
something: bool
};
// ...
}
Expected
composes array is ['important/path']
Actual
composes array is ['lodash/omit']
i'm not even sure how this should be handled.
In example above it seems that extracting first argument from function
should be enough. But what if the composed prop types are not first
argument?
Should react-docgen support such cases at all? It seems valid to do so
from JS perspective but generated documentation is incomplete.
Recently https://github.com/reactjs/react-docgen/issues/248 was closed, so perhaps this issue should be considered too.
Thanks for the library!
- 主要语言
- TypeScript
- 星标
- 3.8k
- 派生
- 316
- 平均合并
- 3 小时 28 分钟
- 30 天内合并 PR
- 6
环境准备
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
reactjs/react-docgen 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
reactjs/react-docgen#1102 ·
-
难度 5/5 一周以上 新手友好度 20/100
reactjs/react-docgen#1005 · 4 个 reaction ·
-
难度 3/5 1-2 天 新手友好度 48/100
reactjs/react-docgen#997 ·
-
难度 3/5 1-2 天 新手友好度 42/100
reactjs/react-docgen#994 · 1 条评论 ·
-
难度 4/5 3-5 天 新手友好度 25/100
reactjs/react-docgen#982 · 2 条评论 ·
查看 reactjs/react-docgen 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
melgarafael/DeskcommCRM#1812 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 84/100
prisma/prisma-cli#309 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
gregwebs/pi-quota-dispatcher#26 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 74/100
openwatersio/slackwater.xyz#124 ·
维护者通常 1 天内回复
-
agent-reported area/browser area/docs documentation good first issue hacktoberfest help wanted P2
难度 1/5 1 小时以内 新手友好度 90/100
维护者通常 2 天内回复