Browse Source

Fix mismatch between props used in code snippet PR1098

zhongsp 4 years ago
parent
commit
7142fb182e
1 changed files with 3 additions and 3 deletions
  1. 3 3
      doc/handbook/JSX.md

+ 3 - 3
doc/handbook/JSX.md

@@ -344,18 +344,18 @@ class Component extends React.Component<PropsType, {}> {
 }
 }
 
 
 // OK
 // OK
-<Component>
+<Component name="foo">
   <h1>Hello World</h1>
   <h1>Hello World</h1>
 </Component>
 </Component>
 
 
 // Error: children is of type JSX.Element not array of JSX.Element
 // Error: children is of type JSX.Element not array of JSX.Element
-<Component>
+<Component name="bar">
   <h1>Hello World</h1>
   <h1>Hello World</h1>
   <h2>Hello World</h2>
   <h2>Hello World</h2>
 </Component>
 </Component>
 
 
 // Error: children is of type JSX.Element not array of JSX.Element or string.
 // Error: children is of type JSX.Element not array of JSX.Element or string.
-<Component>
+<Component name="baz">
   <h1>Hello</h1>
   <h1>Hello</h1>
   World
   World
 </Component>
 </Component>