Skip to content

refactor(react): update tab-bar requirement on tabs - #29868

Merged
thetaPC merged 1 commit into
mainfrom
tabs-remove-requirement
Sep 12, 2024
Merged

refactor(react): update tab-bar requirement on tabs#29868
thetaPC merged 1 commit into
mainfrom
tabs-remove-requirement

Conversation

@thetaPC

@thetaPCthetaPC commented Sep 12, 2024

Copy link
Copy Markdown
Contributor

Issue number: N/A


What is the current behavior?

As mentioned in this PR, React IonTabs requires IonTabBar do be a child, else it doesn't render and throws an error.

Angular, JS, and Vue doesn't have this requirement.

What is the new behavior?

I didn't see any reason why React does not mimic the other frameworks. In order to keep consistency, I've updated the React tabs. This would allow ion-tabs and ion-tab-bar can be used as standalone elements as mentioned in the docs.

  • React follows the same structure as the other frameworks: IonTabs doesn't require IonTabBar to be a child to render.

Does this introduce a breaking change?

  • Yes
  • No

Other information

Dev build: 8.3.1-dev.11726159792.1a6f49de

How to test:

  1. Create a Ionic React app through the Ionic CLI with tabs as the starter
  2. Run the app
  3. Comment out the IonTabBar
  4. Notice that the IonTabs does not render
  5. Notice that there's an error in the console: "IonTabs needs a IonTabBar"
  6. Install the dev build: npm install @ionic/react@8.3.1-dev.11726159792.1a6f49de
  7. Make sure the IonTabBar is still commented out
  8. Verify that IonTabs renders
  9. Verify that there isn't an error in the console

@vercel

vercelBot commented Sep 12, 2024

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for Git ↗︎

NameStatusPreviewCommentsUpdated (UTC)
ionic-framework✅ Ready (Inspect)Visit Preview💬 Add feedbackSep 12, 2024 4:06pm

@github-actionsgithub-actionsBot added the package: react @ionic/react package label Sep 12, 2024
@thetaPC
thetaPC marked this pull request as ready for review September 12, 2024 16:57
@thetaPC
thetaPC requested a review from a team as a code ownerSeptember 12, 2024 16:57
@thetaPCthetaPC changed the title refactor(react): update tabbar requirement on tabsrefactor(react): update tab-bar requirement on tabsSep 12, 2024

@tanner-reitstanner-reits left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Repro steps worked

@thetaPC
thetaPC added this pull request to the merge queueSep 12, 2024
Merged via the queue into main with commit ab7a0abSep 12, 2024
@thetaPC
thetaPC deleted the tabs-remove-requirement branch September 12, 2024 23:29
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

package: react@ionic/react package

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@thetaPC@tanner-reits