Can't make it work onClick
See original GitHub issueI might be very stupid but I can’t make it work… it’s been like an hour yet the tooltip keeps showing.
I have a button, and the tooltip.
const tooltipRef = useRef(null);
<button
className={styles.actionButton}
onClick={() => {
ReactTooltip.show(tooltipRef);
}}
data-tip=""
data-event="click"
>
<ReactTooltip type="error" ref={tooltipRef}>
<span>Show happy face</span>
</ReactTooltip>
I want to control when the tooltip displays or not, and I am not being able to control it. It automatically displays. What am I doing wrong?
Issue Analytics
- State:
- Created 3 years ago
- Comments:6
Top Results From Across the Web
JavaScript button onclick not working - Stack Overflow
Ran into this problem myself so I can confirm something's not right. The difference is that I am generating the DOm Element at...
Read more >onclick function() doesn't work... - Sololearn
in the html i code: Hello A in the js page, i code: function click(){ document.getElementById("h1. ... onclick function() doesn't work.
Read more >React onClick event handlers: A complete guide
Learn the basics of React's onClick event handler, including event listening, onClick buttons, synthetic events, custom events, and more.
Read more >Onclick not working - JavaScript - SitePoint Forums
whenever I use onclick in javascript (not with onclick attribute in html) it doesn't work. I've never been able to get it to...
Read more >Cant get onClick event to work for changing posts , Reddit Client
Nothing I have tried is working. I am trying to change the subreddit when you click on a subreddit. full code : https://github.com/Emm…...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This isn’t working because you passed the entire
ref
, instead ofref.current
.The following worked for me!
Yeah that’s what actually happened to me. https://www.cssportal.com/css-tooltip-generator/ and that’s it haha
The problem is that I only found this library, or other bigger libraries that have a lot of things that I don’t need now, like Reactstrap or material UI