File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed
Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ import { ValueObject } from "tuplerone";
44const keyFilter = ( [ key ] ) => ! key . startsWith ( "_" ) ;
55export const createValueElement = ( type , props , ...children ) => {
66 const element = createElement ( type , props , ...children ) ;
7- if ( typeof type === "string" ) {
7+ if ( typeof type === "string" || typeof type === "symbol" ) {
88 return element ;
99 }
1010 return ValueObject ( element , keyFilter ) ;
Original file line number Diff line number Diff line change 11import { createValueElement } from "../src" ;
22import { shallow } from "tuplerone" ;
3+ import { ValueObject } from "tuplerone" ;
34
45describe ( "createValueElement" , ( ) => {
56 it ( "works with props" , ( ) => {
6- const c = ( ) => null ;
7- const el1 = createValueElement ( c , { a : { b : 1 } } ) ;
8- const el2 = createValueElement ( c , { a : { b : 1 } } ) ;
7+ const el1 = createValueElement ( Function , { z : { b : 1 } } ) ;
8+ const el2 = createValueElement ( Function , { z : { b : 1 } } ) ;
99
1010 expect ( el1 ) . toBe ( el2 ) ;
11+ expect ( el1 . props ) . toBe ( el2 . props ) ;
1112 } ) ;
1213
1314 it ( "handles circular references" , ( ) => {
You can’t perform that action at this time.
0 commit comments