Skip to content

Instantly share code, notes, and snippets.

View hoangthau's full-sized avatar
🎯
Focusing

Thau Nguyen hoangthau

🎯
Focusing
View GitHub Profile
import React, { Component } from 'react';
// Family chỉ làm nhiệm vụ trung chuyển props cho Person
const Family = (props) => (
<div className="family">
<Person info={props.person} />
</div>
)
class Person extends Component {
import React, { Component } from 'react';
// đầu tiên tạo một context
const MyContext = React.createContext();
// Sau đó tạo một Context Provider
class MyProvider extends Component {
state = {
name: 'Dan',
age: 100,