I\'m working in react and basically I want to make an button with tooltip, right now I\'m making tooltip. I\'m changing css display property in order to make it visible or n
Thanks to @RyanWheale I noticed my mistake.
In my render function I was returning a button element which called a function which changed a certain state. The returned button looked like this:
And my edit
function changes some state and looks like this:
edit: function () {
this.setState({editing: true});
}
So, I my mistake is that I, accidentally, typed the parenthesis after this.edit
. So, when the button element was being rendered, the edit function was actually called and chaos happened. Now, when I wrote
instead of
it worked flawlessly. I hope I help someone save hours of his precious life.
Cheers :)