Skip to content

Commit

Permalink
#31 [ Router ] React Router
Browse files Browse the repository at this point in the history
  • Loading branch information
fdhhhdjd committed Sep 21, 2023
1 parent cde051c commit 1bb604b
Show file tree
Hide file tree
Showing 6 changed files with 53 additions and 12 deletions.
12 changes: 9 additions & 3 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@
import React, { Fragment } from 'react';

//* PROP
import Prop_Drilling from './prop_drilling';
// import Prop_Drilling from './prop_drilling';

//* HOOK
import Hook from './hooks/hook';
// import Hook from './hooks/hook';

//* ROUTER
import RouterMain from './routers/router';

//* LIB
// import Lib from './libs/lib';
Expand All @@ -23,7 +26,10 @@ function App() {
{/* <Prop_Drilling /> */}

{/* HOOK */}
<Hook />
{/* <Hook /> */}

{/* ROUTER */}
<RouterMain />

{/* LIB */}
{/* <Lib /> */}
Expand Down
6 changes: 3 additions & 3 deletions src/hooks/useState/useState.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import React, { Fragment } from 'react';
//* Hook
// import LearnOne from "./learn_1";
// import LearnTow from "./learn_2";
import LearnThree from './learn_3';
// import LearnFour from "./learn_4";
// import LearnThree from './learn_3';
// import LearnFour from './learn_4';
// import LearnFive from "./learn_5";
// import LearnSix from "./learn_6";
// import LearnSeven from "./learn_7";
Expand All @@ -16,7 +16,7 @@ function UseState() {
<Fragment>
{/* <LearnOne /> */}
{/* <LearnTow /> */}
<LearnThree />
{/* <LearnThree /> */}
{/* <LearnFour /> */}
{/* <LearnFive /> */}
{/* <LearnSix /> */}
Expand Down
7 changes: 1 addition & 6 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ import './index.css';
import App from './App';
import reportWebVitals from './reportWebVitals';

//* LIBRARY
import { BrowserRouter as Router } from 'react-router-dom';

import 'react-toastify/dist/ReactToastify.css';

//* ROOT
Expand All @@ -15,9 +12,7 @@ const root = ReactDOM.createRoot(document.getElementById('root'), {
});
root.render(
<React.StrictMode>
<Router>
<App />
</Router>
<App />
</React.StrictMode>
);

Expand Down
11 changes: 11 additions & 0 deletions src/routers/1.Router Types/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import React from 'react';

const index = () => {
return (
<>
<h1>Router Types</h1>
</>
);
};

export default index;
11 changes: 11 additions & 0 deletions src/routers/Main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import React from 'react';

const Main = () => {
return (
<>
<h1>Main</h1>
</>
);
};

export default Main;
18 changes: 18 additions & 0 deletions src/routers/router.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
//* REACT
import React from 'react';

//* LIBRARY
import { BrowserRouter as Router } from 'react-router-dom';
import Main from './Main';

const RouterMain = () => {
return (
<>
<Router>
<Main />
</Router>
</>
);
};

export default RouterMain;

0 comments on commit 1bb604b

Please sign in to comment.