Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

React: IonTabButton cannot be wrapped for use with IonTabBar

未关闭
#2,099 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
1/5
预计耗时
1-3 小时
新手友好度
45/100
Issue 类型
文档
描述清晰度
基本清楚
活跃度
停滞
技术栈
react
领域
documentation

调研方向

从 https://ionicframework.com/docs/api/tab-bar 的 IonTabBar 文档开始,查看其中如何描述 IonTabButton 的用法。使用报告中的 wrapper 示例,记录将 IonTabButton 包装在另一个组件中会导致 IonTabBar 无法识别它;当读者能够清楚理解这一限制时即完成。

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

描述

triage

URL
https://ionicframework.com/docs/api/tab-bar

What is missing or inaccurate about the content on this page?

It seems that IonTabButton cannot be wrapped in another component; IonTabBar won't recognize it.

This should be noted in the documentation.

Background

My app puts the IonTabButton in a different order depending on whether the user is right-handed or left-handed.

Example of code that doesn't work (tabs are not displayed):

    return (
      <IonTabs>
        {children}
        <IonTabBar slot="bottom" className="app-tab-bar">
          <TabButtonHome />
          <TabButtonHelp />
        </IonTabBar>
      </IonTabs>

And here is a wrapper component:

const TabButtonHelp: React.VFC = () => (
  <IonTabButton tab="tab-help" href={routeTabHelp}>
    <IonIcon icon={helpOutline} />
    <IonLabel>
      <Trans id="tabbar_title.help">Help</Trans>
    </IonLabel>
  </IonTabButton>
);

This does work:

    return (
      <IonTabs>
        {children}
        <IonTabBar slot="bottom" className="app-tab-bar">
          <IonTabButton tab="tab-help" href={routeTabHelp}>
            <IonIcon icon={helpOutline} />
            <IonLabel>
              <Trans id="tabbar_title.help">Help</Trans>
            </IonLabel>
          </IonTabButton>
        </IonTabBar>
      </IonTabs>
主要语言
MDX
星标
620
派生
3.2k
平均合并
1 天 6 小时
30 天内合并 PR
65

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

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

ionic-team/ionic-docs 的其他 Issue

查看 ionic-team/ionic-docs 的全部 Issue

相似的 Issue

更多 Documentation Issue

把新 issue 发到你的邮箱

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