1
1
import * as React from "react" ;
2
- import { createElement , Fragment } from "react" ;
3
2
4
3
export const empty = null ;
5
4
6
- export function keyed ( key ) {
7
- return ( child ) =>
8
- createElement ( Fragment , { key : key } , child ) ;
9
- }
10
-
11
- export function element ( component ) {
12
- return ( props ) =>
13
- Array . isArray ( props . children )
14
- ? createElement . apply ( null , [ component , props ] . concat ( props . children ) )
15
- : createElement ( component , props ) ;
16
- }
17
-
18
- export function elementKeyed ( component ) {
19
- return ( props ) =>
20
- createElement ( component , props ) ;
21
- }
22
-
23
- export function fragment ( children ) {
24
- return createElement . apply ( null , [ Fragment , null ] . concat ( children ) ) ;
25
- }
26
-
27
- export function createContext ( defaultValue ) {
28
- return ( ) =>
29
- React . createContext ( defaultValue ) ;
30
- }
31
-
32
- export function contextProvider ( context ) {
33
- return context . Provider ;
34
- }
35
-
36
- export function contextConsumer ( context ) {
37
- return context . Consumer ;
38
- }
5
+ export const keyed = ( key ) => ( child ) =>
6
+ React . createElement ( React . Fragment , { key : key } , child ) ;
7
+
8
+ export const element = ( component ) => ( props ) =>
9
+ Array . isArray ( props . children )
10
+ ? React . createElement . apply ( null , [ component , props ] . concat ( props . children ) )
11
+ : React . createElement ( component , props ) ;
12
+
13
+ export const elementKeyed = ( component ) => ( props ) =>
14
+ React . createElement ( component , props ) ;
15
+
16
+ export const fragment = ( children ) =>
17
+ React . createElement . apply ( null , [ React . Fragment , null ] . concat ( children ) ) ;
18
+
19
+ export const createContext = ( defaultValue ) => ( ) =>
20
+ React . createContext ( defaultValue ) ;
21
+
22
+ export const contextProvider = ( context ) => context . Provider ;
23
+
24
+ export const contextConsumer = ( context ) => context . Consumer ;
0 commit comments