Closed CyriacBr closed 2 years ago
@CyriacBr The value
won't be used when stringifying the result to JSX, which relies on the more granular estree
definition.
Provide a data.estree
in the expression node describing the expression that should be generated (for example, a test
literal).
Yep, as @ElMassimo describes, the string version (value
) is ignored when dealing with JavaScript. A subtree node.data.estree
is used instead, which is a whole Program
node
@ElMassimo Thank you both, that was indeed the missing part.
:wave: I am trying to add an evaluated prop to an existing Node but can't figure out the right way to do it. I tried to add a
mdxJsxAttributeValueExpression
attribute, but it does not appear once XDM compiles.Reproduction:
XDM output:
As you can see here:
<MyComp prop1="test" prop2={}><_components.p>{"fooBar"}</_components.p></MyComp>
The
mdxJsxAttributeValueExpression
attribute is not processed.Any help would be appreciated.