diff --git a/CHANGELOG.md b/CHANGELOG.md index a869e7dce..068291752 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [Unreleased] +### Fixed +- Use props `children` in slots if slot children is empty. + ## [8.126.10] - 2021-01-26 ### Fixed diff --git a/react/utils/slots.tsx b/react/utils/slots.tsx index 2b2285133..d4c228e85 100644 --- a/react/utils/slots.tsx +++ b/react/utils/slots.tsx @@ -52,7 +52,11 @@ export function generateSlot({ runtime={runtime} hydration={hydration} > - {slotChildren} + {Array.isArray(slotChildren) && + slotChildren.length === 0 && + componentLoaderPropsWithContent.children + ? componentLoaderPropsWithContent.children + : slotChildren} ) }