Skip to content

Regression - Tooltip crash #3578

Description

@0Lucifer0
  • I have searched the issues of this repository and believe that this is not a duplicate.

Reproduction link

Edit on CodeSandbox

Steps to reproduce

  • Update to 2.6.0
  • Add a tooltip inside an empty TreeMap with ResponsiveContainer
    `
    import "./styles.css";
    import React from "react";
    import { Tooltip, ResponsiveContainer, Treemap } from "recharts";

const data = [];

export default function App() {
return (





);
}
`

What is expected?

Not to crash

What is actually happening?

It is most likely due to this change 0b231b7

It does not crash without the ResponsiveContainer

TypeError: Cannot read properties of null (reading 'x')
at Tooltip (http://localhost:6006/vendors-node_modules_mui_icons-material_ArrowDropDown_js-node_modules_mui_icons-material_Arro-341c65.iframe.bundle.js:40382:18)
at renderWithHooks (http://localhost:6006/vendors-node_modules_apollo_client_testing_react_MockedProvider_js-node_modules_storybook_add-b19fe8.iframe.bundle.js:75503:18)
at mountIndeterminateComponent (http://localhost:6006/vendors-node_modules_apollo_client_testing_react_MockedProvider_js-node_modules_storybook_add-b19fe8.iframe.bundle.js:79267:13)
at beginWork (http://localhost:6006/vendors-node_modules_apollo_client_testing_react_MockedProvider_js-node_modules_storybook_add-b19fe8.iframe.bundle.js:80780:16)
at beginWork$1 (http://localhost:6006/vendors-node_modules_apollo_client_testing_react_MockedProvider_js-node_modules_storybook_add-b19fe8.iframe.bundle.js:86619:14)
at performUnitOfWork (http://localhost:6006/vendors-node_modules_apollo_client_testing_react_MockedProvider_js-node_modules_storybook_add-b19fe8.iframe.bundle.js:85753:12)
at workLoopSync (http://localhost:6006/vendors-node_modules_apollo_client_testing_react_MockedProvider_js-node_modules_storybook_add-b19fe8.iframe.bundle.js:85659:5)
at renderRootSync (http://localhost:6006/vendors-node_modules_apollo_client_testing_react_MockedProvider_js-node_modules_storybook_add-b19fe8.iframe.bundle.js:85627:7)
at recoverFromConcurrentError (http://localhost:6006/vendors-node_modules_apollo_client_testing_react_MockedProvider_js-node_modules_storybook_add-b19fe8.iframe.bundle.js:85043:20)
at performConcurrentWorkOnRoot (http://localhost:6006/vendors-node_modules_apollo_client_testing_react_MockedProvider_js-node_modules_storybook_add-b19fe8.iframe.bundle.js:84943:22)

Environment Info
Recharts v2.6.0
React 18
System Windows 11
Browser Brave

Metadata

Metadata

Assignees

No one assigned

    Labels

    P0Critical priority issuesbugGeneral bug label

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions