@@ -22,6 +22,7 @@ import {
2222 createEffect ,
2323 createMemo ,
2424 createRenderEffect ,
25+ createSignal ,
2526 onCleanup ,
2627} from "solid-js" ;
2728import { declareUpdate } from "../SpringValue" ;
@@ -110,13 +111,15 @@ export function createSprings<Props extends CreateSpringsProps>(
110111
111112 // Cache old controllers to dispose in the commit phase.
112113 const prevLength = lengthFn ( ) || 0 ;
114+ const [ update , setUpdate ] = createSignal ( Symbol ( ) )
113115
114116 // Update existing controllers when "deps" are changed.
115117 createRenderEffect ( ( ) => {
116118 const length = lengthFn ( ) ;
117119 declareUpdates ( 0 , Math . min ( prevLength , length ) ) ;
118120 } ) ;
119121
122+
120123 /** Fill the `updates` array with declarative updates for the given index range. */
121124 function declareUpdates ( startIndex : number , endIndex : number ) {
122125 for ( let i = startIndex ; i < endIndex ; i ++ ) {
@@ -130,6 +133,7 @@ export function createSprings<Props extends CreateSpringsProps>(
130133 updates [ i ] = declareUpdate ( update ) ;
131134 }
132135 }
136+ setUpdate ( Symbol ( ) )
133137 }
134138
135139 // New springs are created during render so users can pass them to
@@ -138,6 +142,8 @@ export function createSprings<Props extends CreateSpringsProps>(
138142 const springs = ctrls . map ( ( ctrl , i ) => getSprings ( ctrl , updates [ i ] ) ) ;
139143
140144 createRenderEffect ( ( ) => {
145+ update ( )
146+
141147 layoutId ++ ;
142148
143149 // Replace the cached controllers.
0 commit comments