-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
created a tour project using context Api
- Loading branch information
Showing
13 changed files
with
69,289 additions
and
127 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,27 @@ | ||
import React, { useState } from 'react'; | ||
import data from './data'; | ||
import List from './List'; | ||
import React, { useState } from "react"; | ||
import data from "./data"; | ||
import List from "./List"; | ||
function App() { | ||
return <h2>reminder project setup</h2>; | ||
const [check, setcheck] = useState(false); | ||
const [people, setpeople] = useState(data); | ||
if (people.length === 0) { | ||
return ( | ||
<main> | ||
<section className="container"> | ||
<button onClick={() => setpeople(data)}>restore</button> | ||
</section> | ||
</main> | ||
); | ||
} | ||
return ( | ||
<main> | ||
<section className="container"> | ||
<h3>{people.length} birthdays today</h3> | ||
<List people={people} /> | ||
<button onClick={() => setpeople([])}>clear all </button> | ||
</section> | ||
</main> | ||
); | ||
} | ||
|
||
export default App; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
import React from 'react'; | ||
import ReactDOM from 'react-dom'; | ||
import './index.css'; | ||
import App from './App'; | ||
import React from "react"; | ||
import ReactDOM from "react-dom"; | ||
import "./index.css"; | ||
import App from "./App"; | ||
|
||
ReactDOM.render( | ||
<React.StrictMode> | ||
<App /> | ||
</React.StrictMode>, | ||
document.getElementById('root') | ||
document.getElementById("root") | ||
); |
Oops, something went wrong.