Skip to content

TypeScript: usage of DeepPartial for preloadedState is too deep #2808

Closed
@OliverJAsh

Description

@OliverJAsh

Do you want to request a feature or report a bug?

Bug

What is the current behavior?

Since #2679, we use DeepPartial for the type of preloadedState.

This means that, given a state tree, all properties at any level in the tree are optional.

What is the expected behavior?

Given a state tree, only properties whose state is computed by a reducer should be optional. This is because reducers have initial state, but the state within them may be required (unless those properties are explicitly marked as optional or they represent reducers).

Which versions of Redux, and which browser and OS are affected by this issue? Did this work in previous versions of Redux?

N/A


/cc @aikoven @dawnmist

I'm not quite sure how we can write the type definition to match the expected behaviour. Any ideas?

Related #2552

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions