1
0
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:
checktheroads
2021-01-04 00:20:46 -07:00
parent d3a328e327
commit 1f26a6c67b
4 changed files with 4 additions and 266 deletions

View File

@@ -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;
};

View File

@@ -1,3 +1,4 @@
export interface TIf {
c: boolean;
children?: React.ReactNode;
}