Component that returns an array is not recognised
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 45/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- react, typescript
- 领域
- documentation, tooling
调研方向
复现位于 some/folder/index.jsx 中,并通过 react-styleguidist 集成产生;首先跟踪返回数组的组件是如何被识别的。为这种组件形状添加一个回归用例,并确认它不会产生缺少组件的警告。
由索引模型根据 Issue 内容生成。
描述
Current behavior
Components that return an array lead to the following error (via react-styleguidist):
Warning: some/folder/index.jsx matches a pattern defined in “components” or “sections” options in your style guide config but doesn’t export a component.
It usually happens when using third-party libraries, see possible solutions here:
https://react-styleguidist.js.org/docs/thirdparties.html
To reproduce
/**
* @param {Props} props props
* @property {Array.<Etcetera>} etc
* @returns {React.Node} ...
*/
const Contents = ({ contents }: Props) =>
contents.map(data => {
switch (data.__typename) {
case 'Something':
return (
<Something children={data.children} key={data.id} />
)
}
})
Expected behavior
No warning
- 主要语言
- 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 小时 新手友好度 84/100
bcgov/bc-wallet-mobile#4761 · 1 条评论 ·
-
external-issue to-triage
难度 2/5 1-3 小时 新手友好度 88/100
-
area-deployment area-integrations triage:bot-seen
难度 2/5 半天 新手友好度 86/100
-
难度 2/5 1-3 小时 新手友好度 82/100
-
refactor
难度 2/5 1-3 小时 新手友好度 84/100