What does the `NoInfer` utility type introduced in TypeScript 5.4 do?

TypeScript Professional Hard

TypeScript Professional — Hard

What does the `NoInfer` utility type introduced in TypeScript 5.4 do?

Key points

  • `NoInfer` prevents TypeScript from inferring the type from a single usage site.
  • It defers type inference to other parts of the code.
  • This utility type helps in controlling how type parameters are inferred in complex scenarios.

Ready to go further?

Related questions