We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3aa50af commit a08a579Copy full SHA for a08a579
4.html
@@ -60,6 +60,9 @@ <h1>JSX</h1>
60
<section style="text-align: left;">
61
<h2>Example</h2>
62
<pre><code class="hljs">
63
+import * as React from "react";
64
+import { render } from "react-dom"
65
+
66
class ShoppingList extends React.Component {
67
render() {
68
return (
@@ -74,6 +77,14 @@ <h1>Shopping List for {this.props.name}</h1>
74
77
);
75
78
}
76
79
80
81
+let baseDiv = document.querySelector("#root");
82
83
+// Note the this.props.name. We can pass that prop during construction as below:
84
+// Props in react are just attributes on their
85
86
+// Below is the render function from react-dom. It injects a react component into a component in the regular dom.
87
+render(<ShoppingList name="Whatever" />, baseDiv)
88
</code></pre>
89
</section>
90
</div>
0 commit comments