my blog https://overreacted.io

Fix JSX props log for Greeting (#802)

authored by Igor Zhukovin and committed by GitHub 899c8d36 897ff212

Changed files
+2 -2
public
a-chain-reaction
+2 -2
public/a-chain-reaction/index.md
··· 177 177 ```js 178 178 const originalJSX = <Greeting person={alice} />; 179 179 console.log(originalJSX.type); // Greeting 180 - console.log(originalJSX.props); // { firstName: 'Alice', birthYear: 1970 } 180 + console.log(originalJSX.props); // { person: { firstName: 'Alice', birthYear: 1970 } } 181 181 ``` 182 182 183 183 Under the hood, JSX constructs an object with the `type` property corresponding to the tag, and the `props` property corresponding to the JSX attributes. ··· 210 210 ```js {5-7} 211 211 const originalJSX = <Greeting person={alice} />; 212 212 console.log(originalJSX.type); // Greeting 213 - console.log(originalJSX.props); // { firstName: 'Alice', birthYear: 1970 } 213 + console.log(originalJSX.props); // { person: { firstName: 'Alice', birthYear: 1970 } } 214 214 215 215 const browserJSX = translateForBrowser(originalJSX); 216 216 console.log(browserJSX.type); // 'p'