-
-
Notifications
You must be signed in to change notification settings - Fork 208
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
I recently upgraded my project to use react-resizable-panels v4.0, but when I create a new Group with different id for each Panel, the page crashed with an error message:
Uncaught TypeError: can't access property "toFixed", e is undefined
A minimal demo with React and TailwindCSS can be created like this:
// App.tsx
import { useState } from "react";
import "./index.css";
import { Group, Panel, Separator } from "react-resizable-panels";
export function App() {
const [workspace, setWorkspace] = useState<"A" | "B">("A");
return (
<div className="flex size-full flex-col">
<div className="m-3 flex gap-2">
Workspace:
<select
className="w-20 border bg-gray-50"
value={workspace}
onChange={(v) => setWorkspace(v.target.value as "A" | "B")}
>
<option value="A">A</option>
<option value="B">B</option>
</select>
</div>
<div className="h-full grow bg-red-50">
<Group id={workspace} className="h-full">
<Panel id={`${workspace}-left`}>Left</Panel>
<Separator className="h-full w-1 bg-gray-400" />
<Panel id={`${workspace}-right`}>Right</Panel>
</Group>
</div>
</div>
);
}
export default App;/* index.css */
@import "tailwindcss";
@layer base {
:root {
@apply font-sans;
}
html,
body,
#root {
@apply m-0 size-full bg-white text-black;
}
}Initially it works fine in workspace A, but if you change to workspace B use the select box, it crashes.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working