@@ -11,7 +11,7 @@ import {
1111import  *  as  G  from  'shared/globals' 
1212
1313import  {  Lookup ,  Falsy  }  from  './types/common' 
14- import  {  getDefaultProp  }  from  './helpers' 
14+ import  {  getDefaultProp ,   getDefaultProps  }  from  './helpers' 
1515import  {  FrameValue  }  from  './FrameValue' 
1616import  {  SpringPhase ,  CREATED ,  ACTIVE ,  IDLE ,  PAUSED  }  from  './SpringPhase' 
1717import  {  SpringValue ,  createLoopUpdate ,  createUpdate  }  from  './SpringValue' 
@@ -267,6 +267,7 @@ export async function flushUpdate(
267267  isLoop ?: boolean 
268268) : AsyncResult  { 
269269  const  {  keys,  to,  loop,  onRest }  =  props 
270+   const  defaults  =  is . obj ( props . default )  &&  props . default 
270271
271272  // Looping must be handled in this function, or else the values 
272273  // would end up looping out-of-sync in many common cases. 
@@ -278,10 +279,14 @@ export async function flushUpdate(
278279  if  ( asyncTo )  { 
279280    props . to  =  undefined 
280281    props . onRest  =  undefined 
281-   }  else  { 
282-     // For certain events, use batching to prevent multiple calls per frame. 
283-     // However, batching is avoided when the `to` prop is async, because any 
284-     // event props are used as default props instead. 
282+     if  ( defaults )  { 
283+       defaults . onRest  =  undefined 
284+     } 
285+   } 
286+   // For certain events, use batching to prevent multiple calls per frame. 
287+   // However, batching is avoided when the `to` prop is async, because any 
288+   // event props are used as default props instead. 
289+   else  { 
285290    each ( BATCHED_EVENTS ,  key  =>  { 
286291      const  handler : any  =  props [ key ] 
287292      if  ( is . fun ( handler ) )  { 
@@ -304,6 +309,10 @@ export async function flushUpdate(
304309            } 
305310          } )  as  any 
306311        } 
312+         // Avoid using a batched `handler` as a default prop. 
313+         if  ( defaults )  { 
314+           defaults [ key ]  =  props [ key ]  as  any 
315+         } 
307316      } 
308317    } ) 
309318  } 
0 commit comments