allotment icon indicating copy to clipboard operation
allotment copied to clipboard

Support for React 19 as a peer dependency

Open argawow opened this issue 1 year ago • 9 comments

Hi there,

Thank you for maintaining this amazing library! I recently upgraded my project to React 19 and noticed that allotment currently has peer dependency constraints for React versions ^17.0.0 || ^18.0.0.

The library appears to work perfectly with React 19 in my tests. Would you consider updating the peerDependencies to include React 19?

Let me know if I can assist with testing or providing more details. Thanks in advance!

Best regards,
Andreas

argawow avatar Dec 18 '24 05:12 argawow

I am getting a lot of fatal errors Index out of bounds with react 19 and this library

criloz avatar Dec 18 '24 14:12 criloz

Checked it again, everything works fine for me.

argawow avatar Dec 19 '24 06:12 argawow

Checked it again, everything works fine for me.

It mostly happens when you rapidly change windows size, and/or have conditional rendering of the panels, I ended using my own solution built with react-aria because my application only have 2 panels anyway

criloz avatar Dec 19 '24 12:12 criloz

use-resize-observer will require review and/or update https://github.com/ZeeCoder/use-resize-observer/blob/master/package.json#L75

I guess we should track issue of use-resize-observer update to react 19

glebcha avatar Dec 20 '24 11:12 glebcha

I would also really appreciate it if this library had support for React 19.

DoubleDebug avatar Dec 23 '24 11:12 DoubleDebug

I've managed to get it working with the --legacy-peer-deps option, but I think I may have to look for an alternative library. Does anyone know of any other libraries that they would recommend?

Jun-Murakami avatar Jan 03 '25 15:01 Jun-Murakami

I've released v1.20.3.

It's just a change to the peer dependencies. In particular the dependency use-resize-observer will produce conflicts for the time being when using React 19 due to it only declaring support up to React 18.

johnwalley avatar Feb 11 '25 10:02 johnwalley

@johnwalley maybe better to add pure useResizeObserver implementation mentioned in https://github.com/ZeeCoder/use-resize-observer/issues/108#issuecomment-2837671374 ?

glebcha avatar May 14 '25 08:05 glebcha