If I have some widget’s prop refering to another widgets value, like this :
it works fine.
But I would need to change dynamically some properties of a clone :
…doesn’t work
What should be the correct syntax or method to achieve this ?
Maybe it’s better to think it the other way : have a script in my colorSelector widget that sets the clone’s props when its valu changes, but I can’t see how to do that…
Clicking on “props” in the inspector will show the computed value for this property. The problem here is that the @{} block is replaced with the retrieved value, but it lacks the quotation marks
{
"colorWidget": red
}
Should be:
{
"colorWidget": "red"
}
Two ways to avoid that: enquote the @{} block, or define the props property with a JS block:
JS{{
return {
colorWidget: @{widget_id}
}
}}
In this context, @{} blocks are seen as javascript variables (where a string is enquoted automatically).
Sidenote: writing @{widget_id} is the same as writing @{widget_id.value}