Skip to content
Snippets Groups Projects
Commit ef1b5ca1 authored by Martin Wighus Holtmon's avatar Martin Wighus Holtmon
Browse files

projectFirstPart/Problem4 - Removed boud function

parent c9c02efd
Branches
No related tags found
No related merge requests found
...@@ -7,12 +7,10 @@ import Header from "./components/header/Header"; ...@@ -7,12 +7,10 @@ import Header from "./components/header/Header";
class P4 extends React.Component { class P4 extends React.Component {
constructor(props) { constructor(props) {
super(props); super(props);
this.handleButtonClick = this.handleButtonClick.bind(this);
this.state = {activePage: States, nextPage: Example} this.state = {activePage: States, nextPage: Example}
console.log(this.state.activePage.name)
} }
handleButtonClick() { handleButtonClick = () => {
this.setState({activePage: this.state.nextPage, nextPage: this.state.activePage}) this.setState({activePage: this.state.nextPage, nextPage: this.state.activePage})
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment