Dear Elements-team,
I believe I’ve discovered a fundamental issue with Custom Components in RapidWeaver Elements (v1.2.2), and after lots of testing and elimination, I’m pretty sure this isn’t user error!
Summary:
No matter what properties I add to my custom component (text, number, toggle, resource), none are available via $props in the HTML template. Not even a simple text property shows up, and even <pre x-text="JSON.stringify($props, null, 2)"></pre>shows absolutely nothing. This makes building dynamic custom components impossible.
Steps to Reproduce:
- Create a new project and add a Custom Component.
- Use this
properties.json:
{
"groups": [
{
"title": "Test Props",
"properties": [
{ "title": "Texty", "id": "texty", "text": {} },
{ "title": "Numbery", "id": "numbery", "number": {} }
]
}
]
}
- In the HTML template, add:
<div x-data>
<div>Text: <span x-text="$props.texty"></span></div>
<div>Number: <span x-text="$props.numbery"></span></div>
<pre x-text="JSON.stringify($props, null, 2)"></pre>
</div>
- Fill in the Inspector fields and go to Preview. Nothing is rendered (values don’t show, JSON is empty).
I also tested with images (“resource”), arrays, and Boolean toggles (which don’t appear at all in the inspector). No data shows up in the template for any property type.
What I Expected:
That $props would contain (at minimum) the values from the Inspector for text, number, toggle, and resource fields—just like in almost all custom component/documentation examples.
What Happens:
$props is empty. Can’t render anything based on component properties. Only static HTML works.
Am I missing a trick, or is $props just not wired up in custom components currently? Maybe it is even the wrong parameter name?
If this is a known issue, is there any ETA or workaround?
If not—please consider this a high-priority bug report! This makes most interactive custom components impossible.
Thanks for your help,
Hans
Tagging @dan, @tpbradley for dev wisdom!
