wix-incubator / react-templates

Light weight templates for react
https://wix.github.io/react-templates
MIT License
2.82k stars 207 forks source link

Unexpected identifier error on a wrong line #166

Open yaelavgil opened 8 years ago

yaelavgil commented 8 years ago

When writing rt-props instead of rt-scope the error is 'Line 3: Unexpected identifier'. Example rt file:

<div rt-props="this as that"></div>
nippur72 commented 8 years ago

where is the example?

yaelavgil commented 8 years ago

link to fiddle

nippur72 commented 8 years ago

rt-props has a different syntax (and purpose) than rt-scope. It's used to pass an object into props, e.g.:

<mycomponent rt-props="{a: '42'}"></mycomponent>

which is the same as writing

<mycomponent a="42"></mycomponent>