diff --git a/src/App.js b/src/App.js index 3017066..dbb854a 100644 --- a/src/App.js +++ b/src/App.js @@ -1,19 +1,36 @@ -import React from "react"; -import Greet from "./Greet"; -const App = () => { +import React, { useState, createContext } from "react"; +import "./App.css"; + +const info = { + name: "John", + age: 20, + gender: "male" +}; + +const ThemeContext = createContext(info); + +const Person = () => { + const info = React.useContext(ThemeContext); + console.log(info); return (
- -

This is a para

-
- - - - - - +

+ {info.name}, {info.age}, {info.gender} +

); }; +const Family = () => { + return ; +}; + +const App = () => { + return ( + + + + ); +}; + export default App; diff --git a/src/Greet.js b/src/Greet.js deleted file mode 100644 index bf19bd8..0000000 --- a/src/Greet.js +++ /dev/null @@ -1,16 +0,0 @@ -import React from "react"; -import "./App.css"; - -const Greet = (props) => { - const { name, age, gender } = props; - console.log(props); - return ( - <> -

Hello {name}

-

My age is {age}

-

My gender is {gender}

- {props.children} - - ); -}; -export default Greet;