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} +
My age is {age}
-My gender is {gender}
- {props.children} - > - ); -}; -export default Greet;