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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Console Error: When using Tab component in combination with a label and an icon the console throws "pseudo class :first-child is potentially unsafe" #28547

Closed
RunRanger opened this issue Sep 22, 2021 · 1 comment
Labels
duplicate This issue or pull request already exists

Comments

@RunRanger
Copy link

RunRanger commented Sep 22, 2021

By using Icon Tabs with label the following error will appear in the console twice:

The pseudo class ":first-child" is potentially unsafe when doing server-side rendering. Try changing it to ":first-of-type".


eg.:
<Tabs value={value} onChange={handleChange} aria-label="icon label tabs example">
    <Tab icon={<PhoneIcon />} label="Calls" />
</Tabs>

If you remove the label or icon attribute of the component, the error won't appear anymore.

This error also appears in the example of the official mui-documentation about IconLabelTabs:
https://codesandbox.io/s/zhmxj?file=/demo.tsx

Expected Behavior 🤔

No error or warning should appear in the console.

Steps to Reproduce 🕹

  1. Open the sandbox of the MUI-Documentation about Icon-Tabs with labels or create a Icon-Label Tabs scenario by yourself
    https://codesandbox.io/s/zhmxj?file=/demo.tsx
  2. Open the console

Your Environment 🌎

I'm using the latest @mui-version
"@mui/icons-material": "^5.0.0"
"@mui/lab": "*"
"@mui/material": "^5.0.0"
"@mui/styles": "^5.0.0"

Browser: Chrome Version 93.0.4577.82

@RunRanger RunRanger added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Sep 22, 2021
@RunRanger RunRanger changed the title Tab component in combination with a label and an icon causes a "pseudo class :first-child is potentially unsafe" error in the console Console Error: When using Tab component in combination with a label and an icon the console throws "pseudo class :first-child is potentially unsafe" Sep 23, 2021
@mnajdova
Copy link
Member

Duplicate of #24894

@mnajdova mnajdova marked this as a duplicate of #24894 Sep 24, 2021
@github-actions github-actions bot added duplicate This issue or pull request already exists and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Sep 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants