Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- changeActive = () => {
- const { students } = this.state;
- if (students.active === true) {
- let studentCopy = JSON.parse(JSON.stringify(this.state.student));
- studentCopy[0].active = false;
- this.setState({
- student: studentCopy
- });
- } else {
- let studentCopy = JSON.parse(JSON.stringify(this.state.student));
- studentCopy[0].active = true;
- this.setState({
- student: studentCopy
- });
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement