Skip to content

Instantly share code, notes, and snippets.

@lequanghuylc
lequanghuylc / BaseComponent.js
Last active May 31, 2019 09:58
[BaseComponent] React BaseComponent that can give you more control over React Component #react
import { Component } from "react";
import PropTypes from "prop-types";
export default class BaseComponent extends Component {
static propTypes = {
id: PropTypes.string
}
static States = {};
@lequanghuylc
lequanghuylc / contextRootChild.js
Last active May 31, 2019 09:59
[Global Store in React using context] #react
import React, { Component } from 'react';
import PropTypes from 'prop-types';
class Root extends Component {
static childContextTypes = {
appState: PropTypes.func
};
getChildContext = () => {