From c5c86304bb1455b76f609d5aa82c0613befc556a Mon Sep 17 00:00:00 2001 From: Mike Bender Date: Tue, 17 Dec 2024 16:26:12 -0500 Subject: [PATCH] fix: Add createXComponent stub for support in Grizzly (#2319) - Just stub it out so deephaven.ui v0.22 works in Grizzly - Prerequisite for DH-18058 --- packages/components/src/XComponent.tsx | 15 +++++++++++++++ packages/components/src/index.ts | 1 + 2 files changed, 16 insertions(+) create mode 100644 packages/components/src/XComponent.tsx diff --git a/packages/components/src/XComponent.tsx b/packages/components/src/XComponent.tsx new file mode 100644 index 0000000000..fc08b4e3a9 --- /dev/null +++ b/packages/components/src/XComponent.tsx @@ -0,0 +1,15 @@ +import React from 'react'; + +/** + * Stub of a helper function to wrap a component with a replacement component. In this case though, it will just return the original component. + * + * @param Component The component to wrap + * @returns The wrapped component + */ +export function createXComponent

>( + Component: React.ComponentType

+): React.ComponentType

{ + return Component; +} + +export default createXComponent; diff --git a/packages/components/src/index.ts b/packages/components/src/index.ts index 2b0ff450a6..288cb0f527 100644 --- a/packages/components/src/index.ts +++ b/packages/components/src/index.ts @@ -56,3 +56,4 @@ export { default as TimeSlider } from './TimeSlider'; export { default as ToastNotification } from './ToastNotification'; export * from './UIConstants'; export { default as UISwitch } from './UISwitch'; +export * from './XComponent';