bvaughn / react-resizable-panels

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

`PanelOnResize` arg `prevMixedSizes` typed as required but is not present on init #208

Closed psychedelicious closed 10 months ago

psychedelicious commented 10 months ago

v57 Repro: https://codesandbox.io/p/sandbox/stoic-elion-fp8m2n

Note the console output for prevMixedSizes is undefined on init

I think it makes sense to leave the type as required and make prevMixedSizes === mixedSizes on init. That's a nicer than typing it as optional and needing to do a lot of checks.

bvaughn commented 10 months ago

The type is incorrect for the initial render. My apologies.

bvaughn commented 10 months ago

react-resizable-panels@0.0.58 has been published with this fix