I have a very simple React component and I noticed that my react hot reload doesn't work if I write my functions inside components like this
class Profile extends Component {
renderSkills = () => skills.map(skill => (
<div key={skill}>
<Button>{skill} + 3</Button>
</div>
))
render() {
return (
<div>{this.renderSkills()}</div>
)
}
}
but it works fine if I write it like this
renderSkills() {
return skills.map(skill => (
<div key={skill}>
<Button>{skill} + 3</Button>
</div>
}
So the hot reloading only doesn't work inside that function, if change something inside that function. If I change anything outside of it , it works normally.
In console I see that change was applied it just doesn't show up on the screen untill I reload the page.
What could be the problem?