Demo3
As in the last demo:
-
This React demo places the component script in Script2.js in a "js" folder
and the styles in StyleSheet2.css in a "css" folder.
-
The only script you need in the body is an execution script block at the end
to execute component code with a ReactDOM.render statement.
-
This means that we can save component scripts in site folders just like ordinary JavaScript
and stylesheets. All we need to place on each page is a placeholder div, like the first one
just after body starts in this page, and a script block at the end that renders the control
or controls.
This demo also defines three components in the script file: Hello, Goodbye, and App which holds the
first two.