BUG: If element has zero width, entry is not defined
See original GitHub issueBug 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:
- Created a year ago
- Comments:17 (17 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@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)
@wellyshen thanks for your awesome work and accepting my PR! Closing this issue now