Skip to content

example of state merging in reducer not compliant with TS v2.4 #4

Closed
@khell

Description

@khell

Hi,

Thank you for the guide.

How would you recommend the example on "Spread operation with Exact Types check to guard against excess or mismatched props" be used with strictNullChecks? As a Partial makes all properties nullable, it is required to define all State in this form:

export type State = {
  readonly counter: number | undefined,
  readonly baseCurrency: string | undefined,
};

This is the same as effectively switching strictNullChecks off. Is there any other way?

Cheers.

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions