Closed maheffa closed 5 years ago
Hey @maheffa, I think you have missed this section: https://github.com/piotrwitek/typesafe-actions#extending-internal-types-to-enable-type-free-syntax-with-createreducer
I have updated API docs to be clearer about createReducer API and linked to the relevant tutorial section.
PS: codesandbox is not supporting all TS features and it's using v3.3, best to use your local env to reproduce type issues
Hey @piotrwitek, I am also facing this issue on v4.4.0 and typescript 3.4.5.
The current sandbox version is suffering the same issue as well (i cloned the project and ran it in my local env):
Hey @Kenpa I have just checked a clean installation of codesandbox in the recent master and there is no such issue. Please doublecheck on recent please.
My bad, misread my typescript version, was running an old one... Sorry for that
No biggie 😉
On Mon, Jun 24, 2019, 11:43 PM Tchi-An Jean PHOU notifications@github.com wrote:
My bad, misread my typescript version, was running an old one... Sorry for that
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/piotrwitek/typesafe-actions/issues/154?email_source=notifications&email_token=AAFUOA3UM2BPXMV7D3ILLPLP4E5Y3A5CNFSM4HNZDBO2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODYOKICQ#issuecomment-505193482, or mute the thread https://github.com/notifications/unsubscribe-auth/AAFUOAYZXOFBHHVD2IXGDGTP4E5Y3ANCNFSM4HNZDBOQ .
Description
The field
payload
cannot be accessed in the reducer, even if the action is generated using the enhancer, or thecreateStandardAction
utility. This is also the case for the current version of the code on codesandbox///features/todos/reducer.ts:20
Steps to Reproduce
simple-action-reducer.ts
Expected behavior
payload
field should be recognized by the compiler.Project Dependencies