-
-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tooltip is not rendering correctly #129
Comments
@jaywcjlove I am doing that already. Did you have a look a the <HeatMap
value={value}
startDate={new Date('2016/01/01')}
rectRender={(props, data) => {
if (!data.count) return <rect {...props} />;
return (
<Tooltip placement="top" content={`count: ${data.count || 0}`}>
<rect {...props} />
</Tooltip>
);
}}
/> |
@iamsmkr I didn't find any issues while looking at the examples: https://codesandbox.io/embed/sweet-aj-jpl6mx?fontsize=14&hidenavigation=1&theme=dark |
I was with the same error and was unable to resolve it. I ended up using react-tooltip its pretty straight forward: <div>
<HeatMap
value={value}
startDate={new Date('2016/01/01')}
rectRender={(props, data) => {
if (!data.count) return <rect {...props} />;
return (
<rect {...props} data-tooltip-id="my-tooltip" data-tooltip-content={`${data.date}: ${data.count || 0} posts`}/>
);
}}
/>
<Tooltip id="my-tooltip" />
</div> |
This may not be a good permanent solution, but i found turning off React.StrictMode fixes this rendering problem. I am using react-heat-map and (@uiw/)react-tooltip with vite, so I changed my ReactDOM.createRoot(document.getElementById('root')).render(
/* <React.StrictMode> */
<App />
/* </React.StrictMode>, */
) |
I have the same problem, the tooltip is aways on the top left corner, i am using nextjs. |
@mentaLwz follow @goncaloalves solution |
Same problem, it also rerenders, the component entirely |
I am trying to make use of this tool in following contrived example and the tool tip doesn't seem to be rendering correctly. Not sure what is wrong. Please suggest!
Screen.Recording.2024-04-01.at.4.11.53.pm.mov
package.json
Demo.js
App.js
index.js
The text was updated successfully, but these errors were encountered: