From 83f6e8b15f8c0c9556c5da98d84165bd9380d5c6 Mon Sep 17 00:00:00 2001 From: Edward Smith <65724195+esmith80@users.noreply.github.com> Date: Sun, 18 May 2025 11:52:33 -0600 Subject: [PATCH 1/4] update to get rid of errors with react 18 and vite --- src/App.jsx | 20 ++++++++++++++++++++ src/Button.jsx | 6 ++++++ src/main.jsx | 31 +++++++------------------------ 3 files changed, 33 insertions(+), 24 deletions(-) create mode 100644 src/App.jsx create mode 100644 src/Button.jsx diff --git a/src/App.jsx b/src/App.jsx new file mode 100644 index 0000000..04b0ae9 --- /dev/null +++ b/src/App.jsx @@ -0,0 +1,20 @@ +import { useState } from 'react'; +import './Button.jsx'; + +const App = () => { + // your code here + + const reset = () => { + console.log("reset"); + // your code here + }; + + return ( +
+ {/* your code here -- this entire line including the curly braces can be removed */} +

Hello React

+
+ ); +}; + +export default App; diff --git a/src/Button.jsx b/src/Button.jsx new file mode 100644 index 0000000..db05daf --- /dev/null +++ b/src/Button.jsx @@ -0,0 +1,6 @@ +const Button = (props) => { + // your code here +}; + +export default Button; + diff --git a/src/main.jsx b/src/main.jsx index 0b8451b..1ec0a4d 100644 --- a/src/main.jsx +++ b/src/main.jsx @@ -1,26 +1,9 @@ -import React, { useState } from 'react'; -import ReactDOM from 'react-dom'; +// src/main.jsx +import React from 'react'; +import ReactDOM from 'react-dom/client'; +import App from './App.jsx'; import './index.css'; -const Button = (props) => { - // your code here -}; - -const Application = () => { - - // your code here - - const reset = () => { - console.log("reset"); - // your code here - }; - - return ( -
- {/* your code here -- this entire line including the curly braces can be removed */} -

Hello React

-
- ); -}; - -ReactDOM.render(, document.getElementById("root")); +const container = document.getElementById('root'); +const root = ReactDOM.createRoot(container); +root.render(); From b1fc6464b0bb1ac25550414b2339ab219f26f48e Mon Sep 17 00:00:00 2001 From: Edward Smith <65724195+esmith80@users.noreply.github.com> Date: Sun, 18 May 2025 11:59:28 -0600 Subject: [PATCH 2/4] fix button export --- src/Button.jsx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/Button.jsx b/src/Button.jsx index db05daf..6296421 100644 --- a/src/Button.jsx +++ b/src/Button.jsx @@ -1,6 +1,4 @@ -const Button = (props) => { +export const Button = (props) => { // your code here }; -export default Button; - From ae1874203eb20d95ac0bcd6b623a159ea351ed4a Mon Sep 17 00:00:00 2001 From: Edward Smith <65724195+esmith80@users.noreply.github.com> Date: Sun, 18 May 2025 11:59:55 -0600 Subject: [PATCH 3/4] fix button import in app --- src/App.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/App.jsx b/src/App.jsx index 04b0ae9..c2eaea7 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -1,5 +1,5 @@ import { useState } from 'react'; -import './Button.jsx'; +import { Button } from './Button.jsx' const App = () => { // your code here From b4e0d8646591475004166009220fa3bab10f8ffd Mon Sep 17 00:00:00 2001 From: Edward Smith <65724195+esmith80@users.noreply.github.com> Date: Tue, 20 May 2025 07:47:22 -0600 Subject: [PATCH 4/4] reduce back to one working file --- src/App.jsx | 5 ++++- src/Button.jsx | 4 ---- 2 files changed, 4 insertions(+), 5 deletions(-) delete mode 100644 src/Button.jsx diff --git a/src/App.jsx b/src/App.jsx index c2eaea7..0b48662 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -1,5 +1,8 @@ import { useState } from 'react'; -import { Button } from './Button.jsx' + +export const Button = (props) => { + // your code here +}; const App = () => { // your code here diff --git a/src/Button.jsx b/src/Button.jsx deleted file mode 100644 index 6296421..0000000 --- a/src/Button.jsx +++ /dev/null @@ -1,4 +0,0 @@ -export const Button = (props) => { - // your code here -}; -