facebook / jsx

The JSX specification is a XML-like syntax extension to ECMAScript.
http://facebook.github.io/jsx/
1.96k stars 133 forks source link

Declarative complex attribute values #83

Open borela opened 7 years ago

borela commented 7 years ago

Sorry if this has been sugested before; Other markup languages like XAML allows attribute values to be expanded:

<Complex 
  someAttribute={
    <SubComponent>Some text value...</SubComponent>
  }
>
  Some children...
</Complex>

Would turn into something like this:

<Complex>
  <Complex@someAttribute>
    <SubComponent>Some text value...</SubComponent>
  <Complex@someAttribute>
  Some children...
</Complex>

The <Complex@someAttribute> would just affect the attribute's value; The symbol @ was chosen for demonstration purposes only but it could be anything else.