Skip to content

Commit

Permalink
Package updates
Browse files Browse the repository at this point in the history
  • Loading branch information
AustinWilloughby committed Apr 9, 2024
1 parent 04e809f commit cd72a75
Show file tree
Hide file tree
Showing 8 changed files with 2,232 additions and 1,741 deletions.
7 changes: 6 additions & 1 deletion client/example1.jsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
//JSX to be built by webpack. See React Functional Component demo.
const React = require('react');
const {createRoot} = require('react-dom/client');

const HelloWorld = () => {
return (
<div>
Expand All @@ -7,7 +11,8 @@ const HelloWorld = () => {
};

const init = () => {
ReactDOM.render(<HelloWorld />, document.getElementById('app'));
const root = createRoot(document.getElementById('app'));
root.render(<HelloWorld />);
};

window.onload = init;
8 changes: 6 additions & 2 deletions client/example2.jsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
//JSX to be built by webpack. See React Functional Component demo.
const React = require('react');
const {createRoot} = require('react-dom/client');

const HelloUser = (props) => {
const [username, setUsername] = React.useState(props.username);

Expand All @@ -11,8 +15,8 @@ const HelloUser = (props) => {
}

const init = () => {
ReactDOM.render( <HelloUser username='Austin' />,
document.getElementById('app'));
const root = createRoot(document.getElementById('app'));
root.render(<HelloUser username='Austin' />);
};

window.onload = init;
9 changes: 5 additions & 4 deletions client/example3.jsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
//JSX to be built by webpack. See React Functional Component demo.
const React = require('react');
const {createRoot} = require('react-dom/client');
const { useState, useEffect } = React;

const SongContainer = (props) => {
Expand Down Expand Up @@ -34,10 +37,8 @@ const SongContainer = (props) => {
}

const init = () => {
ReactDOM.render(
<SongContainer songs={[]} />,
document.getElementById('app')
);
const root = createRoot(document.getElementById('app'));
root.render(<SongContainer songs={[]} />);
}

window.onload = init;
Loading

0 comments on commit cd72a75

Please sign in to comment.