Skip to content

Unable to conditionally render child components #7

@kahyoung-zz

Description

@kahyoung-zz

In the given example:

<Generic type="localBusiness" jsonldtype="LocalBusiness" schema={localBusinessSchema}>
{ratingCount > 0 && <AggregateRating ratingCount={ratingCount} ratingValue={ratingValue} />}
</Generic>

The following error gets thrown:

Cannot read property 'children' of undefined

I think this should be permissible as certain schemas (e.g. aggregate rating) should not be rendered if there are no ratings, but there are currently no ways of conditionally rendering it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions