@@ -11,7 +11,7 @@ import {
1111} from '..' ;
1212
1313test ( 'infer return type via forward prop' , ( ) => {
14- const props = useSpring ( { width : 0 , delay : 1000 } ) ;
14+ const [ props ] = useSpring ( { width : 0 , delay : 1000 } ) ;
1515 assert ( props , _ as {
1616 [ key : string ] : SpringValue < any > ;
1717 width : SpringValue < number > ;
@@ -24,7 +24,7 @@ test('infer return type via forward prop', () => {
2424} ) ;
2525
2626test ( 'infer return type via "from" prop' , ( ) => {
27- const props = useSpring ( {
27+ const [ props ] = useSpring ( {
2828 from : { width : 0 } ,
2929 } ) ;
3030 assert ( props , _ as {
@@ -34,7 +34,7 @@ test('infer return type via "from" prop', () => {
3434} ) ;
3535
3636test ( 'infer return type via "to" prop' , ( ) => {
37- const props = useSpring ( {
37+ const [ props ] = useSpring ( {
3838 to : { width : 0 } ,
3939 } ) ;
4040 assert ( props , _ as {
@@ -44,7 +44,7 @@ test('infer return type via "to" prop', () => {
4444} ) ;
4545
4646test ( 'infer return type via "from" and "to" props' , ( ) => {
47- const props = useSpring ( {
47+ const [ props ] = useSpring ( {
4848 from : { width : 0 } ,
4949 to : { height : '100%' } ,
5050 } ) ;
@@ -56,7 +56,7 @@ test('infer return type via "from" and "to" props', () => {
5656} ) ;
5757
5858test ( 'infer return type via "from" and forward props' , ( ) => {
59- const props = useSpring ( {
59+ const [ props ] = useSpring ( {
6060 from : { width : 0 } ,
6161 height : '100%' ,
6262 } ) ;
@@ -68,7 +68,7 @@ test('infer return type via "from" and forward props', () => {
6868} ) ;
6969
7070test ( 'infer animated array' , ( ) => {
71- const props = useSpring ( {
71+ const [ props ] = useSpring ( {
7272 to : { foo : [ 0 , 0 ] } ,
7373 } ) ;
7474 assert ( props , _ as {
@@ -166,7 +166,7 @@ test('spring refs', () => {
166166} ) ;
167167
168168test ( 'basic config' , ( ) => {
169- const props = useSpring ( {
169+ const [ props ] = useSpring ( {
170170 from : { width : 0 } ,
171171 reset : true ,
172172 delay : 1000 ,
@@ -187,7 +187,7 @@ test('basic config', () => {
187187} ) ;
188188
189189test ( 'function as "to" prop' , ( ) => {
190- const props = useSpring ( {
190+ const [ props ] = useSpring ( {
191191 to : async next => {
192192 assert ( next , _ as SpringUpdateFn ) ;
193193
@@ -209,7 +209,7 @@ test('function as "to" prop', () => {
209209 } ) ;
210210
211211 test ( 'with "from" prop' , ( ) => {
212- const props = useSpring ( {
212+ const [ props ] = useSpring ( {
213213 from : { foo : 1 } ,
214214 to : async next => {
215215 assert ( next , _ as SpringUpdateFn ) ; // FIXME: should be "SpringUpdateFn<{ foo: number }>"
@@ -229,7 +229,7 @@ test('function as "to" prop', () => {
229229
230230test ( 'array as "to" prop' , ( ) => {
231231 // ⚠️ Animated keys are not inferred when "to" is an array (unless "from" exists)
232- const props = useSpring ( {
232+ const [ props ] = useSpring ( {
233233 to : [ { opacity : 1 } , { opacity : 0 } ] ,
234234 foo : 0 , // ️️⚠️ This key is ignored because "to" exists
235235 } ) ;
@@ -239,7 +239,7 @@ test('array as "to" prop', () => {
239239 } ) ;
240240
241241 test ( 'with "from" prop' , ( ) => {
242- const props = useSpring ( {
242+ const [ props ] = useSpring ( {
243243 to : [ { opacity : 1 } , { opacity : 0 } ] ,
244244 from : { opacity : 0 } ,
245245 } ) ;
0 commit comments