What is the purpose of double curly braces in React's JSX syntax?

javascript, reactjs

Solution

It's just an object literal inlined in the prop value. It's the same as

var obj = {__html: rawMarkup};

<span dangerouslySetInnerHTML={obj} />

Problem

From the react.js tutorial we see this usage of double curly braces: ``` <span dangerouslySetInnerHTML={{ __html: rawMarkup }} /> ``` And then in the second tutorial, "Thinking in react": ``` <span style={{ color: 'red' }}> {this.props.product.name} </span>; ``` However, the React JSX documentation doesn't describe or mention double curly braces. What is this syntax (double curlies) for? And is there another way to express the same thing in jsx or is this just an omission from the documentation?

Original source