Hi everyone am a newbie in react and have encountered this problem, need help
https://codesandbox.io/s/interesting-sara-q2j9w?file=/src/App.js
For further actions, you may consider blocking this person and/or reporting abuse
Hi everyone am a newbie in react and have encountered this problem, need help
https://codesandbox.io/s/interesting-sara-q2j9w?file=/src/App.js
For further actions, you may consider blocking this person and/or reporting abuse
Muchhal Sagar -
Mitchell -
Dusan Petkovic -
Samir -
Top comments (3)
Here, I fixed it for you. codesandbox.io/s/exciting-cdn-ip9w...
The issue was in the handleView method you were using the '!' on an array not a boolean.
Also, there was an issue in the mapping of teachers because React was missing the 'key' prop in order to render the teachers properly.
It was a small mistake @josephSam check what I changed here codesandbox.io/s/reverent-sun-oppw...
handleView = e => {
e.preventDefault();
let ta = this.state.showPersons;
this.setState({
showPersons: !ta
});
};