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

Tabs: Conditional rendering -> Cannot read properties of null (reading 'type') #8798

Closed
6 tasks done
baur opened this issue Mar 21, 2023 · 1 comment · Fixed by #8801
Closed
6 tasks done

Tabs: Conditional rendering -> Cannot read properties of null (reading 'type') #8798

baur opened this issue Mar 21, 2023 · 1 comment · Fixed by #8801
Labels
bug An error in the Docusaurus core causing instability or issues with its execution domain: theme Related to the default theme components

Comments

@baur
Copy link

baur commented Mar 21, 2023

Have you read the Contributing Guidelines on issues?

Prerequisites

  • I'm using the latest version of Docusaurus.
  • I have tried the npm run clear or yarn clear command.
  • I have tried rm -rf node_modules yarn.lock package-lock.json and re-installing packages.
  • I have tried creating a repro with https://new.docusaurus.io.
  • I have read the console error message carefully (if applicable).

Description

I got an error: Cannot read properties of null (reading 'type')

Reproducible demo

No response

Steps to reproduce

<Tabs>
  <TabItem value="apple" label="Apple" default>
    This is an apple 🍎
  </TabItem>
  <TabItem value="orange" label="Orange">
    This is an orange 🍊
  </TabItem>
  {1===0?<TabItem value="banana" label="Banana">
    This is a banana 🍌
  </TabItem>:null}
</Tabs>

Expected behavior

Do not render third Tab

Actual behavior

image

Your environment

  • Docusaurus version used: 2.3.1
  • Environment name and version (e.g. Chrome 89, Node.js 16.4): Chrome
  • Operating system and version (e.g. Ubuntu 20.04.2 LTS): Windows11
@baur baur added bug An error in the Docusaurus core causing instability or issues with its execution status: needs triage This issue has not been triaged by maintainers labels Mar 21, 2023
@baur
Copy link
Author

baur commented Mar 21, 2023

same behavior md and mdx

@Josh-Cena Josh-Cena added domain: theme Related to the default theme components and removed status: needs triage This issue has not been triaged by maintainers labels Mar 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An error in the Docusaurus core causing instability or issues with its execution domain: theme Related to the default theme components
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants