enhancementgood first issue
倉庫指標
- 星標
- (13,807 顆星)
- PR 合併指標
- (平均合併 6天 16小時) (30 天內合併 3 個 PR)
描述
Hi 👋
Context
I would like to create a custom component to be reusable inside all the documentation 😍
type IframeProps = {
url: string;
};
export const Iframe: FunctionComponent<IframeProps> = ({ url }) => {
return <iframe src={url} allowFullScreen className={styles.main} />;
};
Problem
Regarding the following documentation 👀
In the code, type is define as components?: Record<string, FC> | undefined; but it's a little bit to strict because we can't pass any additional props.
Cannot assign type 'FC<OptionTableProps>' to type 'FC'.
Parameter types 'props' and 'props' are incompatible.
Unable to assign type '{}' to type 'OptionTableProps'. ts(2322)
Proposal solution
What about the possibility to accept a generic to pass additional props ? Is there any side effect for this improvement ?
components?: Record<string, FC<T>> | undefined;
I could open a PR if needed to support 😇 Thanks for it 🙏