Skip to content

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

@baur

Description

@baur

Have you read the Contributing Guidelines on issues?

Prerequisites

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugAn error in the Docusaurus core causing instability or issues with its executiondomain: themeRelated to the default theme components

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions