@@ -573,6 +573,23 @@ object HooksTest extends TestSuite {
573573 protected implicit def hooksExt1 [Ctx , Step <: HooksApi .AbstractStep ](api : HooksApi .Primary [Ctx , Step ]): X_UseEffect_Primary [Ctx , Step ]
574574 protected implicit def hooksExt2 [Ctx , CtxFn [_], Step <: HooksApi .SubsequentStep [Ctx , CtxFn ]](api : HooksApi .Secondary [Ctx , CtxFn , Step ]): X_UseEffect_Secondary [Ctx , CtxFn , Step ]
575575
576+ def testSingle (): Unit = {
577+ val counter1 = new Counter
578+ val counter2 = new Counter
579+ def state () = s " ${counter1.value}: ${counter2.value}"
580+
581+ val comp = ScalaFnComponent .withHooks[Unit ]
582+ .X_useEffect (counter1.incCB.ret(counter2.incCB))
583+ .X_useEffect (counter1.incCB(101 ))
584+ .X_useEffect (counter1.incCB.ret(counter2.incCB))
585+ .render(_ => EmptyVdom )
586+
587+ test(comp()) { _ =>
588+ assertEq(state(), " 103:0" )
589+ }
590+ assertEq(state(), " 103:2" )
591+ }
592+
576593 def testConst (): Unit = {
577594 val counter1 = new Counter
578595 val counter2 = new Counter
@@ -1292,6 +1309,7 @@ object HooksTest extends TestSuite {
12921309 " useDebugValue" - testUseDebugValue()
12931310 " useEffect" - {
12941311 import UseEffect ._
1312+ " single" - testSingle()
12951313 " const" - testConst()
12961314 " constBy" - testConstBy()
12971315 " deps" - testWithDeps()
@@ -1302,6 +1320,7 @@ object HooksTest extends TestSuite {
13021320 " useForceUpdate" - testUseForceUpdate()
13031321 " useLayoutEffect" - {
13041322 import UseLayoutEffect ._
1323+ " single" - testSingle()
13051324 " const" - testConst()
13061325 " constBy" - testConstBy()
13071326 " deps" - testWithDeps()
0 commit comments