-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(react): add jsdoc for all non-internal apis
- Loading branch information
Showing
7 changed files
with
110 additions
and
121 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,14 @@ | ||
import React, { ReactNode } from 'react'; | ||
|
||
export const defineRequirement = <T extends {}>(Requirement: React.ComponentType<T>, props?: Pick<T, Exclude<keyof T, 'children'>>) => | ||
(app: ReactNode) => | ||
<Requirement { ...props }>{ app }</Requirement>; | ||
/** | ||
* Helper function for defining requirements | ||
* @description Creates requirement from particular component and props that will be passed to it | ||
* @template T type of props for this `Requirement` component | ||
* @param Requirement component type that will be used as HOC for wrapping `ApplicationRoot` | ||
* @param [props] actual props that have to be passed to `Requirement` | ||
* @returns requirement that could be easily used by `ResolvableComponent` or `withRequirements` HOC | ||
*/ | ||
export function defineRequirement<T extends {}>(Requirement: React.ComponentType<T>, props?: Pick<T, Exclude<keyof T, 'children'>>) { | ||
return (app: ReactNode) => | ||
<Requirement {...props}>{app}</Requirement>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters