[react-tooltip] Element with id 'react-tooltip-base-styles' already exists #1184
Replies: 5 comments 10 replies
-
As a side-note, as you can see on the docs page, the provider has been deprecated, and we're dropping it on V6 (which should come around in the next several months), so we really don't recommend you use it anymore. |
Beta Was this translation helpful? Give feedback.
-
That's good to hear so thanks for stating it. :) Okay, I had a chance to go through a couple scenarios with mixed results. Scenario 1 (on laptop) - note that I used visual code since IDE shouldn't make a difference.
At this point, I thought it may be something that the default cra script puts in the package.json that gets installed into node_modules that may be contributing to this issue. So, I deleted my work project's node_modules and recreated it and that did NOT work as the warnings continued to happen. Scenario 2 (on a desktop install) also using visual code. Here I tried to duplicate my work configuration, i.e., using all the packages including webpack, bundling, etc.
So this is strange because scenario 2 worked fine without any issues with the default cra as opposed to scenario 1 where I had to remove the node_modules from default cra and "refresh" them before it ran clean. So scenario 2 should have showed the warnings if it was a webpack config issue because I duplicated the webpack.config.js from my work project to ensure I was as close as possible. I'm a bit confused now as this seems to be hit and miss but in my work project where I can't get the warnings to go away. If it helps, I followed where the code is firing the warning event here:
I know you said not to sweat it, but I'd rather not have the warnings if it can be helped. :) And yes, I know I can turn off warnings in the console. ;) Let me know if I can help in any other way since I can reproduce this in my work project. |
Beta Was this translation helpful? Give feedback.
-
Okay, thank you. BTW, I did forget to add one control that my work project uses that the test projects I use did NOT: react-data-grid. As I have time this week, I'll update my projects with a simple grid to see if it can be recreated consistently even though it did happen in scenario 1 without it. Just to rule out everything I guess. Thanks again. |
Beta Was this translation helpful? Give feedback.
-
So, I had some time to add the react-data-grid to both test projects and both ran clean with no warnings. I wanted to make sure the grid package was/wasn't the issue and the results indicate it's NOT the culprit. |
Beta Was this translation helpful? Give feedback.
-
I published the project that more closely reflects my work one. The webpack scripts for build and run are buildwp and startwp respectively. I did the whole thing in vs code so that should do the trick. I do use LESS at work so in order to build/compile the .less file, I installed Easy LESS. Don't forget to run |
Beta Was this translation helpful? Give feedback.
-
I just added react-tooltip to our react project and followed the instructions for creating a basic tooltip as well as using the tooltip wrapper and nothing worked. I then noticed that the debug Console view had issues after which I found the error below. The troubleshooting section of the online docs did not have anything on this. Any help would be greatly appreciated as I'm not sure what's causing this.
[react-tooltip] Element with id 'react-tooltip-base-styles' already exists. Call 'removeStyle()' first
I'm attempting to use the tooltip with react-select list using a custom configured component. However, the error occurs when I just put the tooltip component on the view somewhere without referencing it by anything, i.e.,
I prefer to use the wrapper but it's not working even though I see no errors/warnings so not sure what I'm missing as I'm following the doc at https://react-tooltip.com/docs/examples/provider-wrapper.
My react-select is set up wrapped with the tooltip wrapper, i.e.,
The debugger shows the tooltip is getting rendered as a but it's not showing. My App.js is set up as follows:
Let me know if there's other info I can provide. Thanks a lot.
Beta Was this translation helpful? Give feedback.
All reactions