adobe / aio-theme

The Adobe I/O theme for building markdown powered sites
Apache License 2.0
72 stars 43 forks source link

fix: check for isArray instead #1521

Closed dmitrymatio closed 1 year ago

dmitrymatio commented 1 year ago

Description

When only one child ({ }) is passed to children prop it can be either { } or [{ }] depending on how it was passed. This is done for performance and consistent type reasons between rerenders. Changing the length check to isArray check to include this edge case.

Related Issue

Motivation and Context

How Has This Been Tested?

Screenshots (if appropriate):

Types of changes

Checklist:

dmitrymatio commented 1 year ago

Fixes https://github.com/adobe/aio-theme/issues/1518. Missed tagging the issue sorry 🙏