I have an “export default” statement in addition to “class LikeButton”
export default class AppHeader extends React.Component {
constructor() {
super();
this.state = {
liked: false
};
this.handleClick = this.handleClick.bind(this);
}
handleClick() {
this.setState({liked: !this.state.liked});
}
render() {
const text = this.state.liked ? 'liked' : 'haven\'t liked';
return (
<div onClick={this.handleClick}>
You {text} this. Click to toggle.
</div>
);
}
}
https://facebook.github.io/react/docs/interactivity-and-dynamic-uis.html
but the body of the component is copied in from the api samples and still I do not see any event triggered nor function called.
AppHeader class being a child of a component hierarchy - could it be events are not passed down into the hierarchy.
Thank you for any help
jav99