File tree Expand file tree Collapse file tree 2 files changed +13
-0
lines changed
Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -1512,6 +1512,16 @@ describe('SSR hydration', () => {
15121512 expect ( `Hydration attribute mismatch` ) . not . toHaveBeenWarned ( )
15131513 } )
15141514
1515+ test ( 'client value is null or undefined' , ( ) => {
1516+ mountWithHydration ( `<div></div>` , ( ) =>
1517+ h ( 'div' , { draggable : undefined } ) ,
1518+ )
1519+ expect ( `Hydration attribute mismatch` ) . not . toHaveBeenWarned ( )
1520+
1521+ mountWithHydration ( `<input />` , ( ) => h ( 'input' , { type : null } ) )
1522+ expect ( `Hydration attribute mismatch` ) . not . toHaveBeenWarned ( )
1523+ } )
1524+
15151525 test ( 'should not warn against object values' , ( ) => {
15161526 mountWithHydration ( `<input />` , ( ) => h ( 'input' , { from : { } } ) )
15171527 expect ( `Hydration attribute mismatch` ) . not . toHaveBeenWarned ( )
Original file line number Diff line number Diff line change @@ -758,6 +758,9 @@ function propHasMismatch(
758758 if ( isBooleanAttr ( key ) ) {
759759 actual = el . hasAttribute ( key )
760760 expected = includeBooleanAttr ( clientValue )
761+ } else if ( clientValue == null ) {
762+ actual = el . hasAttribute ( key )
763+ expected = false
761764 } else {
762765 if ( el . hasAttribute ( key ) ) {
763766 actual = el . getAttribute ( key )
You can’t perform that action at this time.
0 commit comments