mirror of
https://github.com/checktheroads/hyperglass
synced 2024-05-11 05:55:08 +00:00
fix type error if If component
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import type { TIf } from './types';
|
||||
|
||||
export const If = (props: React.PropsWithChildren<TIf>): React.ReactNode | null => {
|
||||
export const If: React.FC<TIf> = (props: TIf) => {
|
||||
const { c, children } = props;
|
||||
return c ? children : null;
|
||||
return c ? <>{children}</> : null;
|
||||
};
|
||||
|
@@ -1,3 +1,4 @@
|
||||
export interface TIf {
|
||||
c: boolean;
|
||||
children?: React.ReactNode;
|
||||
}
|
||||
|
Reference in New Issue
Block a user