Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit 652e484

Browse files
authored
Merge pull request #5732 from matrix-org/travis/skinning/pt1-ts
[SK-1] Fix types for replaceableComponent
2 parents 0220566 + 92af111 commit 652e484

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/utils/replaceableComponent.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,11 @@ import * as sdk from '../index';
3030
* @param {string} name The dot-path name of the component being replaced.
3131
* @param {React.Component} origComponent The component that can be replaced
3232
* with a skinned version. If no skinned version is available, this component
33-
* will be used.
33+
* will be used. Note that this is automatically provided to the function and
34+
* thus is optional for purposes of types.
35+
* @returns {ClassDecorator} The decorator.
3436
*/
35-
export function replaceableComponent(name: string, origComponent: React.Component) {
37+
export function replaceableComponent(name: string, origComponent?: React.Component): ClassDecorator {
3638
// Decorators return a function to override the class (origComponent). This
3739
// ultimately assumes that `getComponent()` won't throw an error and instead
3840
// return a falsey value like `null` when the skin doesn't have a component.

0 commit comments

Comments
 (0)