bvaughn / react-resizable-panels

https://react-resizable-panels.vercel.app/
MIT License
3.87k stars 135 forks source link

Cannot expand/collapse panel immediately on mount #211

Closed bvaughn closed 10 months ago

bvaughn commented 10 months ago

Context: https://github.com/bvaughn/react-resizable-panels/issues/206#issuecomment-1809369778

Repro: https://codesandbox.io/s/gracious-cannon-h5stq4

timdown commented 10 months ago

resize() also throws an error (probably unsurprisingly).

bvaughn commented 10 months ago

The overall problem is this:

Maybe I could change the registerPanel handler to update the committedValuesRef synchronously (to store the new panels) but I suspect other things might break if that's the only change. I'll look into this further soon though.

bvaughn commented 10 months ago

Fix published in @0.0.59

bvaughn commented 10 months ago

I don't love my fix. Filed #217 to follow up with a better approach.

bvaughn commented 10 months ago

0.0.60 fixes this in a better way.