Skip to content

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

Closed

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

Activity

  1. added
    bug
    status: needs triage
    on Mar 21, 2023
  2. baur commented on Mar 21, 2023

    @baur
    Author

    same behavior md and mdx

  3. added
    domain: theme
    and removed
    status: needs triage
    on Mar 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugdomain: theme

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions