diff --git a/src/utils/replaceableComponent.ts b/src/utils/replaceableComponent.ts index 8c29fdf037..f83e0c95c1 100644 --- a/src/utils/replaceableComponent.ts +++ b/src/utils/replaceableComponent.ts @@ -14,6 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +import { func } from 'prop-types'; import * as React from 'react'; import * as sdk from '../index'; @@ -38,3 +39,12 @@ export function replaceableComponent(name: string, origComponent: React.Componen // return a falsey value like `null` when the skin doesn't have a component. return () => sdk.getComponent(name) || origComponent; } + +/** + * Typescript-compatible version of `replaceableComponent` + * @see replaceableComponent + * @param {string} name The dot-path name of the component being replaced. + */ +export function replaceableComponentTs(name: string) { + return (origComponent: typeof React.Component) => sdk.getComponent(name) || origComponent; +} \ No newline at end of file