Component Not Selectable
You may encounter a situation where your component renders correctly in the preview, but you cannot click to select it in Weaverse Studio. The section appears in the left panel’s section list but clicking it or clicking directly on the preview does nothing — the settings panel stays empty. This is commonly referred to as a “ghost section” and Studio will display a warning on the affected item:
Why This Happens
Weaverse Studio identifies components in the preview by looking for adata-wv-id attribute on the DOM element. This attribute is automatically included in the props that Weaverse passes to your component.
There are two main causes for this issue:
- Props not spread correctly — the
data-wv-idattribute is in the props but never reaches the DOM - Component returns
null— no DOM element is rendered at all, so there’s nothing for Studio to find
How to Fix
Cause 1: Props Not Spread Correctly
When your component doesn’t spread the remaining props (...rest) onto its root DOM element, the data-wv-id attribute never reaches the DOM. Studio can see the component exists in the data layer, but it cannot find the corresponding element in the preview.
Destructure your custom props from the rest
Separate your component-specific props and
children from everything else using the spread operator:Spread the remaining props onto the root DOM element
Pass
...rest to the outermost HTML element. This ensures data-wv-id and all other Weaverse-internal attributes reach the DOM:Before & After
forwardRef, the same rule applies — spread ...rest and pass the ref:
With React 19,
forwardRef becomes less necessary. If you spread all props (including ref) onto the root element, Weaverse can detect the DOM element automatically. See the Weaverse Component guide for more details.Cause 2: Component Returns null
If your component conditionally returns null, no DOM element is rendered at all. Without a DOM element, there’s no place for the data-wv-id attribute to exist, and Studio cannot locate or select the component.
This commonly happens when components guard against missing data.
Find the early return
Look for any
return null statements in your component, especially conditional guards at the top:Always render a root element with props spread
Replace the
return null with an empty self-closing element that spreads ...rest:Before & After
Common Patterns That Cause This
Early returns for missing data
Early returns for missing data
Watch out for any conditional return before the root element:Instead, move the condition inside the root element:
Returning null from a ternary
Returning null from a ternary
This is a subtler version of the same problem:
Checklist
If a component is not selectable in Studio, verify:- The component never returns
null— return an empty element with{...rest}instead - The component destructures custom props and captures
...rest -
...restis spread onto the root DOM element - The development server has been restarted after changes