Skip to content
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

useDimensions is not a function #779

Open
amcdnl opened this issue Jun 7, 2024 · 0 comments
Open

useDimensions is not a function #779

amcdnl opened this issue Jun 7, 2024 · 0 comments

Comments

@amcdnl
Copy link

amcdnl commented Jun 7, 2024

Issue

In my open-source library ( reaviz.dev ), we use this project to measure the chart. In some instances ( such as code sandbox ), I get the following error. You can also live see the error here: https://codesandbox.io/p/sandbox/funny-currying-s7wgcn?file=%2Findex.js&from-embed=

TypeError
useDimensions is not a function
ChartContainer
https://s7wgcn.csb.app/node_modules/reaviz/dist/index.umd.cjs:2112:40
renderWithHooks
https://s7wgcn.csb.app/node_modules/react-dom/cjs/react-dom.development.js:15486:18
mountIndeterminateComponent
https://s7wgcn.csb.app/node_modules/react-dom/cjs/react-dom.development.js:20103:13
beginWork
https://s7wgcn.csb.app/node_modules/react-dom/cjs/react-dom.development.js:21626:16
HTMLUnknownElement.callCallback
https://s7wgcn.csb.app/node_modules/react-dom/cjs/react-dom.development.js:4164:14
Object.invokeGuardedCallbackDev
https://s7wgcn.csb.app/node_modules/react-dom/cjs/react-dom.development.js:4213:16
invokeGuardedCallback
https://s7wgcn.csb.app/node_modules/react-dom/cjs/react-dom.development.js:4277:31
beginWork$1
https://s7wgcn.csb.app/node_modules/react-dom/cjs/react-dom.development.js:27490:7
performUnitOfWork
https://s7wgcn.csb.app/node_modules/react-dom/cjs/react-dom.development.js:26596:12
workLoopSync
https://s7wgcn.csb.app/node_modules/react-dom/cjs/react-dom.development.js:26505:5
renderRootSync
https://s7wgcn.csb.app/node_modules/react-dom/cjs/react-dom.development.js:26473:7
performSyncWorkOnRoot
https://s7wgcn.csb.app/node_modules/react-dom/cjs/react-dom.development.js:26124:20
flushSyncCallbacks
https://s7wgcn.csb.app/node_modules/react-dom/cjs/react-dom.development.js:12042:22
flushSync
https://s7wgcn.csb.app/node_modules/react-dom/cjs/react-dom.development.js:26240:7
legacyCreateRootFromDOMContainer
https://s7wgcn.csb.app/node_modules/react-dom/cjs/react-dom.development.js:29614:5
legacyRenderSubtreeIntoContainer
https://s7wgcn.csb.app/node_modules/react-dom/cjs/react-dom.development.js:29640:12
Object.render
https://s7wgcn.csb.app/node_modules/react-dom/cjs/react-dom.development.js:29731:10
$csb$eval
/index.js:18:9

Here is where I'm leverage the library: https://github.com/reaviz/reaviz/blob/master/src/common/containers/ChartContainer.tsx#L100

Its worth noting this doesn't get thrown all the time, just in some instances ( I haven't figured out what exactly this instance is that causes it though ). Have you seen this before?

Versions

"react-cool-dimensions": "^3.0.1",
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant