File tree Expand file tree Collapse file tree
examples/preact/sorting/src
packages/preact-table/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -64,7 +64,7 @@ function App() {
6464 {
6565 accessorKey : 'progress' ,
6666 header : 'Profile Progress' ,
67- // enableSorting: false, //disable sorting for this column
67+ // enableSorting: false, // disable sorting for this column
6868 } ,
6969 {
7070 accessorKey : 'rank' ,
Original file line number Diff line number Diff line change 1- import type { ComponentType , VNode } from 'preact'
1+ import type { ComponentChild , ComponentType } from 'preact'
22
3- export type Renderable < TProps > =
4- | VNode < TProps >
5- | ComponentType < TProps >
6- | undefined
7- | null
8- | string
9- | number
10- | boolean
3+ export type Renderable < TProps > = ComponentChild | ComponentType < TProps >
114
125function isPreactComponent < TProps > (
136 component : unknown ,
@@ -46,11 +39,11 @@ function isExoticComponent(component: any) {
4639export function flexRender < TProps extends object > (
4740 Comp : Renderable < TProps > | null ,
4841 props : TProps ,
49- ) : VNode < TProps > | Element | null {
42+ ) : ComponentChild | Element | null {
5043 return ! Comp ? null : isPreactComponent < TProps > ( Comp ) ? (
5144 < Comp { ...props } />
5245 ) : (
53- ( Comp as VNode < TProps > | Element | null )
46+ Comp
5447 )
5548}
5649
You can’t perform that action at this time.
0 commit comments