Skip to content

Instantly share code, notes, and snippets.

View imbhargav5's full-sized avatar

Bhargav Ponnapalli imbhargav5

View GitHub Profile
@imbhargav5
imbhargav5 / SimpleTextInput_CWRP.js
Last active September 12, 2018 15:17 — forked from sagiavinash/SimpleTextInput_CWRP.js
SimpleTextInput with CWRP
class SimpleTextInput extend Component {
constructor(props){
super(props)
this.state = {
value : props.value,
_value : props.value
}
}
static getDerivedStateFromProps(newProps,oldState){
if(newProps.value !== oldState._value){
@imbhargav5
imbhargav5 / Enhance.js
Created December 3, 2015 10:03 — forked from sebmarkbage/Enhance.js
Higher-order Components
import { Component } from "React";
export var Enhance = ComposedComponent => class extends Component {
constructor() {
this.state = { data: null };
}
componentDidMount() {
this.setState({ data: 'Hello' });
}
render() {