mirror of
https://github.com/element-hq/element-web
synced 2024-11-26 11:15:53 +03:00
Merge pull request #5732 from matrix-org/travis/skinning/pt1-ts
[SK-1] Fix types for replaceableComponent
This commit is contained in:
commit
652e4845e5
1 changed files with 4 additions and 2 deletions
|
@ -30,9 +30,11 @@ import * as sdk from '../index';
|
||||||
* @param {string} name The dot-path name of the component being replaced.
|
* @param {string} name The dot-path name of the component being replaced.
|
||||||
* @param {React.Component} origComponent The component that can be replaced
|
* @param {React.Component} origComponent The component that can be replaced
|
||||||
* with a skinned version. If no skinned version is available, this component
|
* with a skinned version. If no skinned version is available, this component
|
||||||
* will be used.
|
* will be used. Note that this is automatically provided to the function and
|
||||||
|
* thus is optional for purposes of types.
|
||||||
|
* @returns {ClassDecorator} The decorator.
|
||||||
*/
|
*/
|
||||||
export function replaceableComponent(name: string, origComponent: React.Component) {
|
export function replaceableComponent(name: string, origComponent?: React.Component): ClassDecorator {
|
||||||
// Decorators return a function to override the class (origComponent). This
|
// Decorators return a function to override the class (origComponent). This
|
||||||
// ultimately assumes that `getComponent()` won't throw an error and instead
|
// ultimately assumes that `getComponent()` won't throw an error and instead
|
||||||
// return a falsey value like `null` when the skin doesn't have a component.
|
// return a falsey value like `null` when the skin doesn't have a component.
|
||||||
|
|
Loading…
Reference in a new issue