removing unnecessary bind and using arrow function throughout

This commit is contained in:
Ayush Kumar Sinha 2019-06-28 00:56:20 +05:30
parent a4e42619a4
commit 59b3d94fdf
3 changed files with 11 additions and 19 deletions

View File

@ -16,9 +16,6 @@ import {
class Branches extends React.Component {
constructor(props) {
super(props);
this.toggle = this.toggle.bind(this);
this.Stylemodif = this.Stylemodif.bind(this);
this.state = {
dropdownOpen: false
};
@ -40,12 +37,12 @@ class Branches extends React.Component {
</DropdownItem>
);
};
toggle() {
toggle = () => {
this.setState(prevState => ({
dropdownOpen: !prevState.dropdownOpen
}));
}
Stylemodif(data) {
};
Stylemodif = data => {
return {
...data,
styles: {
@ -54,7 +51,7 @@ class Branches extends React.Component {
maxHeight: 500
}
};
}
};
render() {
return (

View File

@ -99,11 +99,9 @@ class Commits extends React.Component {
<h3>Latest Commits</h3>
{this.props.isLoading.load ? (
<div>
<div>
Fetching latest Commits of <strong>{this.props.branch} </strong>
for you...
<Loading />
</div>
Fetching latest Commits of <strong>{this.props.branch} </strong>
for you...
<Loading />
</div>
) : (
<div>

View File

@ -11,9 +11,6 @@ import { currState, loadPulls } from '../redux/actions';
class pullState extends React.Component {
constructor(props) {
super(props);
this.toggle = this.toggle.bind(this);
this.Stylemodif = this.Stylemodif.bind(this);
this.state = {
dropdownOpen: false
};
@ -32,12 +29,12 @@ class pullState extends React.Component {
</DropdownItem>
);
};
toggle() {
toggle = () => {
this.setState(prevState => ({
dropdownOpen: !prevState.dropdownOpen
}));
}
Stylemodif(data) {
};
Stylemodif = data => {
return {
...data,
styles: {
@ -46,7 +43,7 @@ class pullState extends React.Component {
maxHeight: 500
}
};
}
};
render() {
return (
<Dropdown isOpen={this.state.dropdownOpen} toggle={this.toggle}>