diff --git a/src/hooks/combine-state.ts b/src/hooks/combine-state.ts index 8e89c2e..a849425 100644 --- a/src/hooks/combine-state.ts +++ b/src/hooks/combine-state.ts @@ -84,7 +84,7 @@ export function combineState(...states) { // it is guaranteed that reading `state.getValue` will // return the updated value const updatedValue = states.map((state) => state.getValue()); - combinedState.setValue(() => updatedValue); + combinedState.setValue(updatedValue); }); }); diff --git a/src/hooks/create-state.ts b/src/hooks/create-state.ts index 207c5cc..1f724f4 100644 --- a/src/hooks/create-state.ts +++ b/src/hooks/create-state.ts @@ -436,6 +436,8 @@ function createState( } cb(newSelectedValue); + // update selected value + trackingEffect.selectedValue = newSelectedValue; }); trackingIterators.forEach((trackingIterator) => {