Skip to content

Instantly share code, notes, and snippets.

@agupta93
Created December 16, 2018 06:42
Show Gist options
  • Save agupta93/8b44cf117cefd477899f8bd406f08f96 to your computer and use it in GitHub Desktop.
Save agupta93/8b44cf117cefd477899f8bd406f08f96 to your computer and use it in GitHub Desktop.
import React from 'react';
const Button = props => (
<div onClick={props.onActive}>
Click Me
</div>
)
export default Button
import React, {Component} from 'react';
import Button from './Button';
class ButtonContainer extends Component {
state = {
isActive: false,
}
changeToActive = () => {
this.setState({
isActive: true
})
}
render() {
return (
<Button
onActive={this.changeToActive}
/>
)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment