-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix inference for reducers without actions specified #3475
Fix inference for reducers without actions specified #3475
Conversation
Open in CodeSandbox Web Editor | VS Code | VS Code Insiders | Preview |
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit b029318:
|
@einarq would you be able to try out the package built from this PR, see if it fixes your issue? 🙂 |
Sure, how do I reference it? |
There are install instructions here 😄 |
Ok. It solves the issue, but it introduces another issue (which might be
fine?).
I now get a TS error if I use create.reducer, but I don't supply any types
on the action.
[image: image.png]
…On Thu, May 25, 2023 at 11:44 AM Ben Durrant ***@***.***> wrote:
There are install instructions here
<https://ci.codesandbox.io/status/reduxjs/redux-toolkit/pr/3475/builds/381165>
😄
—
Reply to this email directly, view it on GitHub
<#3475 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABT6D3FQCC2O32MOOOYZG3XH4SXNANCNFSM6AAAAAAYORZGF4>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
hmm, that image doesn't seem to display on github. Could you post a snippet, or adjust the codesandbox with an example? |
ahh, I see - I'm tempted to say this is a good thing though, if you want a payload other than void you should provide it. either by using the usual |
I'm fine with that :) This codebase is gradually converting to TS.
…On Thu, May 25, 2023 at 12:11 PM Ben Durrant ***@***.***> wrote:
ahh, I see - I'm tempted to say this is a good thing though, if you want a
payload other than void you should provide it.
either by using the usual PayloadAction<Payload> or by doing
create.reducer<Payload>(
—
Reply to this email directly, view it on GitHub
<#3475 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABT6D5UZ53YDFW4QRZOZ3LXH4V35ANCNFSM6AAAAAAYORZGF4>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
in the meantime if you want the previous behaviour of using export type TODOFIXME = any;
create.reducer<TODOFIXME>((state, { payload: { orderDir } }) => {}) |
We’ll just fix them as we go, but thanks!On 25 May 2023, at 12:22, Ben Durrant ***@***.***> wrote:
in the meantime if you want the previous behaviour of using any you can always do something like
export type TODOFIXME = any;
create.reducer<TODOFIXME>((state, { payload: { orderDir } }) => {})
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: ***@***.***>
|
fixes #3474