Webflow Developers von Webflow
Leere Slots mit isEmptySlot erkennen
Code-Component-Autoren können mit isEmptySlot leere Slots erkennen und Fallback-Inhalte rendern; Webflow reserviert Prop-Namen mit dem Präfix __wf_.
This update lets code component authors detect empty slots and render fallback content. Webflow now reserves prop names that start with __wf_.
Packages:
@webflow/react``2.7.0@webflow/data-types``2.6.0
Check for empty slots
Call isEmptySlot on a Slot prop value. It returns true when the slot has no children.
import { isEmptySlot } from "@webflow/react";
<div>
{content}
{isEmptySlot(content) ? <p>Drop content here</p> : null}
</div>
Render fallback content next to the slot, not instead of it. Replacing the slot removes the Designer drop target.
Learn more in the isEmptySlot reference.
Reserved __wf_ prop names
Webflow reserves prop names that start with __wf_, in any letter case. The CLI rejects a library that declares one when you bundle it. Rename the prop so it doesn't use that prefix.