bvaughn / react-resizable-panels

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

`getCollapsed` removed in latest version 0.0.57? #214

Closed AmruthPillai closed 10 months ago

AmruthPillai commented 10 months ago
apps/client/src/stores/builder.ts:100:38 - error TS2551:  
Property 'getCollapsed' does not exist on type 'WritableDraft<ImperativePanelHandle>'.  
Did you mean 'collapse'?
          98 | 
          99 |         if (panelRef) {
       > 100 |           const collapsed = panelRef.getCollapsed();
             |                                      ^
         101 |           collapsed ? panelRef.expand() : panelRef.collapse();
         102 |         } else {
         103 |           state.sheet[side].open = !state.sheet[side].open;

I was depending on the getCollapsed getter function to toggle whether or not the panel should be triggered. But I see that it has been removed in the later versions. Is there an alternative for this, or should I downgrade for now?

AmruthPillai commented 10 months ago

Similarly, I'm getting this error as well.

Screenshot 2023-11-18 at 8 28 43 AM

bvaughn commented 10 months ago

Very sorry. Looks like I missed a docs update. The API is now isCollapsed() (or isExpanded() if you prefer). I will update the docs this morning.

bvaughn commented 10 months ago

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

AmruthPillai commented 10 months ago

Thank you for your continued support on the library, it's works great for my use-case!

bvaughn commented 10 months ago

Happy to hear it!