Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TabList] Conditional rendering of Tab fails #26166

Closed
2 tasks done
hubertokf opened this issue May 6, 2021 · 1 comment 路 Fixed by #26170
Closed
2 tasks done

[TabList] Conditional rendering of Tab fails #26166

hubertokf opened this issue May 6, 2021 · 1 comment 路 Fixed by #26170
Labels
bug 馃悰 Something doesn't work component: tabs This is the name of the generic UI component, not the React module!

Comments

@hubertokf
Copy link
Contributor

  • The issue is present in the latest release.
  • I have searched the issues of this repository and believe that this is not a duplicate.

Current Behavior 馃槸

As pointed on Issue 8093, when we have a conditional rendering of a Tab, it throws an error.

Expected Behavior 馃

The expected behavior is not to consider a null as a valid component. This issue was resolved by PR 8107, but for Tabs component.

Steps to Reproduce 馃暪

Just use a condition to render a Tab inside a TabList

Live example on CodeSandbox

Steps:

  1. Render a TabList
  2. Render some Tabs
  3. Conditionaly render a Tab inside TabList

Context 馃敠

I was trying to render a Tab depending on a user state.

Your Environment 馃寧

`npx @material-ui/envinfo`
  System:
    OS: Linux 5.4 Linux Mint 20.1 (Ulyssa)
  Binaries:
    Node: 14.16.0 - /usr/local/bin/node
    Yarn: 1.22.10 - /usr/local/bin/yarn
    npm: 6.14.13 - /usr/local/bin/npm
  Browsers:
    Chrome: 90.0.4430.93
    Firefox: 88.0.1
  npmPackages:
    @material-ui/core: ^4.11.3 => 4.11.3 
    @material-ui/icons: ^4.11.2 => 4.11.2 
    @material-ui/lab: ^4.0.0-alpha.57 => 4.0.0-alpha.57 
    @material-ui/pickers: ^3.3.10 => 3.3.10 
    @material-ui/styles: ^4.11.3 => 4.11.3 
    @material-ui/system:  4.11.3 
    @material-ui/types:  5.1.0 
    @material-ui/utils:  4.11.2 
    @types/react:  17.0.3 
    react: ^17.0.1 => 17.0.1 
    react-dom: ^17.0.1 => 17.0.1 
    styled-components:  5.2.1
@hubertokf hubertokf added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label May 6, 2021
@oliviertassinari oliviertassinari added bug 馃悰 Something doesn't work component: tabs This is the name of the generic UI component, not the React module! and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels May 6, 2021
@oliviertassinari
Copy link
Member

馃憤 it breaks the notion of composition

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 馃悰 Something doesn't work component: tabs This is the name of the generic UI component, not the React module!
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants