Closed
Description
This is for version 0.8.0.
const action = createAction<{ input?: string }>('ACTION')
type ActionType = ReturnType<typeof action> // ActionType.payload === unknown
const action = createAction<{ input?: string, input2: string }>('ACTION')
type ActionType = ReturnType<typeof action> // ActionType.payload === { input?: string | undefined; input2: string }
Somehow, if there is only one property and it's optional, it converts it type to unknown
Metadata
Metadata
Assignees
Labels
No labels