1import {
2 ImperativePanelGroupHandle,
3 Panel,
4 PanelGroup,
5} from "react-native-resizable-panels";
6
7 const ref = useRef<ImperativePanelGroupHandle>(null);
8
9 const resetLayout = () => {
10 const panelGroup = ref.current;
11 if (panelGroup) {
12 // Reset each Panel to 50% of the group's width
13 panelGroup.setLayout([50, 50]);
14 }
15 };
16
17 <PanelGroup direction="horizontal" ref={ref}>
18 <Panel>left</Panel>
19 <ResizeHandle />
20 <Panel>right</Panel>
21 </PanelGroup>