github SBoudrias/Inquirer.js @inquirer/core@12.0.0

latest releases: @sboudrias/package@1.0.2, @inquirer/i18n@1.2.0, @inquirer/demo@2.0.19...
4 hours ago

@inquirer/core@12.0.0

⚠️ Breaking change

The setter returned by useState now accepts an updater/reducer function (currentValue) => nextValue, mirroring React. The updater always receives the latest state (read from the hook store at call time), which simplifies async and reducer-style state updates.

Type change: the setter signature moves from (newValue: Value) => void to (newValue: NotFunction<Value> | Reducer<Value>) => void.

Impact: any code that stored a function as a value via useState's setter now has that function interpreted as a reducer. This is a type-level breaking change for consumers of the core hook API.

What's new

  • useState setter accepts a reducer function (currentValue) => nextValue (#2225)

Dependencies

  • @inquirer/figures bumped to ^2.0.8

Don't miss a new Inquirer.js release

NewReleases is sending notifications on new releases.