style(react 18): explicitly declaring children as optional props
This is to facilitate the react 18 upgrade which introduced the requirement to explicily declare children as props Helps to address #12252 Signed-off-by: Mark David Avery <mark@webark.cc>
This commit is contained in:
@@ -56,7 +56,9 @@ export type TechDocsAddonOptions<TAddonProps = {}> = {
|
||||
};
|
||||
|
||||
// @public
|
||||
export const TechDocsAddons: React_2.ComponentType;
|
||||
export const TechDocsAddons: React_2.ComponentType<
|
||||
React_2.PropsWithChildren<{}>
|
||||
>;
|
||||
|
||||
// @public
|
||||
export interface TechDocsApi {
|
||||
|
||||
@@ -43,7 +43,9 @@ export const TECHDOCS_ADDONS_WRAPPER_KEY = 'techdocs.addons.wrapper.v1';
|
||||
* TechDocs Addon registry.
|
||||
* @public
|
||||
*/
|
||||
export const TechDocsAddons: React.ComponentType = () => null;
|
||||
export const TechDocsAddons: React.ComponentType<
|
||||
React.PropsWithChildren<{}>
|
||||
> = () => null;
|
||||
|
||||
attachComponentData(TechDocsAddons, TECHDOCS_ADDONS_WRAPPER_KEY, true);
|
||||
|
||||
@@ -71,7 +73,9 @@ export function createTechDocsAddonExtension<TComponentProps>(
|
||||
* Create a TechDocs addon implementation.
|
||||
* @public
|
||||
*/
|
||||
export function createTechDocsAddonExtension<TComponentProps>(
|
||||
export function createTechDocsAddonExtension<
|
||||
TComponentProps extends React.PropsWithChildren<{}>,
|
||||
>(
|
||||
options: TechDocsAddonOptions<TComponentProps>,
|
||||
): Extension<(props: TComponentProps) => JSX.Element | null> {
|
||||
const { name, component: TechDocsAddon } = options;
|
||||
|
||||
Reference in New Issue
Block a user