Skip to content

Commit

Permalink
Remove explicit .displayNames used as a workaround for Parcel
Browse files Browse the repository at this point in the history
  • Loading branch information
Andarist committed Jul 1, 2023
1 parent 4f7006f commit 43313cc
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 22 deletions.
6 changes: 0 additions & 6 deletions packages/react-resizable-panels/src/Panel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,12 +195,6 @@ export const Panel = forwardRef<ImperativePanelHandle, PanelProps>(
createElement(PanelWithForwardedRef, { ...props, forwardedRef: ref })
);

// Workaround for Parcel scope hoisting (which renames objects/functions).
// Casting to :any is required to avoid corrupting the generated TypeScript types.
// See github.com/parcel-bundler/parcel/issues/8724
(PanelWithForwardedRef as any).displayName = "Panel";
(Panel as any).displayName = "forwardRef(Panel)";

// HACK
function parseSizeFromStyle(style: CSSProperties): number {
const { flexGrow } = style;
Expand Down
5 changes: 0 additions & 5 deletions packages/react-resizable-panels/src/PanelContexts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,3 @@ export const PanelGroupContext = createContext<{
stopDragging: () => void;
unregisterPanel: (id: string) => void;
} | null>(null);

// Workaround for Parcel scope hoisting (which renames objects/functions).
// Casting to :any is required to avoid corrupting the generated TypeScript types.
// See github.com/parcel-bundler/parcel/issues/8724
(PanelGroupContext as any).displayName = "PanelGroupContext";
6 changes: 0 additions & 6 deletions packages/react-resizable-panels/src/PanelGroup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -767,9 +767,3 @@ export const PanelGroup = forwardRef<
>((props: PanelGroupProps, ref: ForwardedRef<ImperativePanelGroupHandle>) =>
createElement(PanelGroupWithForwardedRef, { ...props, forwardedRef: ref })
);

// Workaround for Parcel scope hoisting (which renames objects/functions).
// Casting to :any is required to avoid corrupting the generated TypeScript types.
// See github.com/parcel-bundler/parcel/issues/8724
(PanelGroupWithForwardedRef as any).displayName = "PanelGroup";
(PanelGroup as any).displayName = "forwardRef(PanelGroup)";
5 changes: 0 additions & 5 deletions packages/react-resizable-panels/src/PanelResizeHandle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,3 @@ export function PanelResizeHandle({
tabIndex: 0,
});
}

// Workaround for Parcel scope hoisting (which renames objects/functions).
// Casting to :any is required to avoid corrupting the generated TypeScript types.
// See github.com/parcel-bundler/parcel/issues/8724
(PanelResizeHandle as any).displayName = "PanelResizeHandle";

0 comments on commit 43313cc

Please sign in to comment.