React Measure is only called for first time
emonno13 opened this issue · 1 comments
emonno13 commented
I have an issue with the height of the scroll change.
Step 01: I load the page.
Step 02: Click a button to hide the top bar.
Step 03: Click a button to show the top bar again.
I don't know why React-measure did not trigger when the top bar is shown again.
Here is my code:
souporserious commented
Hm I'm not sure why the ResizeObserver
wouldn't be picking this up 🤨 maybe due to children being virtualized. I'm pretty busy right now so I won't be able to look into the library itself for a bit, but I think you should be able to grab a ref to the Measure
component and call the internal measure
method yourself to update the dimensions:
function App() {
const ref = React.useRef()
return (
<div>
<button onClick={() => ref.current.measure()}>
Measure programmatically
</button>
<Measure ref={ref}>...</Measure>
</div>
)
}