question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

BUG: If element has zero width, entry is not defined

See original GitHub issue

Bug Report

Describe the Bug

If element has zero width, entry as returned by useDimensions is undefined. Only after width is larger than 1 px, entry will be defined.

How to Reproduce

CodeSandbox Link

https://codesandbox.io/s/throbbing-water-4ujwul?file=/src/App.js

Expected Behavior

Entry should be defined with width 0

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:17 (17 by maintainers)

github_iconTop GitHub Comments

1reaction
sirkrispcommented, Apr 3, 2022

@wellyshen Will create a PR later today or tomorrow. Actually, I am not sure about the initialWidth/Height option - because those I could also pass into the component. What I am really looking for is a simple variable that helps me to differentiate those two special cases above. Maybe I just propose something and then you can decide (won’t be much to code anyway)

0reactions
sirkrispcommented, Nov 30, 2022

@wellyshen thanks for your awesome work and accepting my PR! Closing this issue now

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why is the parent div height zero when it has floated children
The element contains no content that isn't floating (so nothing stops the height of the container being 0, as if it were empty)....
Read more >
Zero-Width Space
The zero-width space on the other hand is technically a space, but rendered with no width. You won't be able to see it....
Read more >
Element.scrollLeft - Web APIs | MDN
The Element.scrollLeft property gets or sets the number of pixels that an element's content is scrolled from its left edge.
Read more >
LLVM Language Reference Manual
Abstract¶. This document is a reference manual for the LLVM assembly language. LLVM is a Static Single Assignment (SSA) based representation that provides ......
Read more >
Built-in Functions — Python 3.11.1 documentation
Return True if all elements of the iterable are true (or if the iterable is ... If x is not a Python int...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found