-
Notifications
You must be signed in to change notification settings - Fork 27.1k
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
feat: add exemple with redux toolkit in typescript #23250
feat: add exemple with redux toolkit in typescript #23250
Conversation
My opinion: I much prefer the simplified RTK example. Is it common folks will be using thunk anyway? Wouldn't they likely use RTK query or SWR/react-query instead? I fear this will set folks off on the wrong foot by being too complicated. If we really want TS, maybe we re-open this one? #23052 Where I struggle is that it's not much different from JS to TS. |
A couple thoughts:
I don't know what particular policies you have here with examples in the Next repo, so I can certainly understand if you'd prefer to only have one of these here. Problem is, at that point should it be the JS one or the TS one? If anything I'd almost say prefer having a TS example, but either way it's gonna exclude some useful info. |
Sounds good to me, just wanted to confirm 👍
+1
No particular policy - just try to prevent one example from being up-to-date and the other which is the 95% the same not getting updated too. I try my best to catch them on code reviews but sometimes it slips. The real solution here is a way to more easily switch between JS/TS in examples and maybe keep the same core codebase? 😄 tl;dr we can move ahead with this 👍 |
Nice. Yeah, I've got a Redux docs issue to update our "Installation" page to start pointing to more of these examples for Next and RN: |
Hey, just a question. Shouldn't a starter template just have the setup of the store and a simple "slice" example like https://github.com/reduxjs/cra-template-redux-typescript? This looks more like a complete app and too complex for a starter template. So if the user starts with this template, it would take them more time to remove unnecessary code which they might not need (like API routes and notes slice) than it would take to do the setup itself. |
Thanks for the review @leerob @markerikson |
Hmm. Yeah, our CRA templates are just a single |
Something like #23052? It is almost identical to https://github.com/reduxjs/cra-template-redux-typescript |
Is this the current example? https://github.com/vercel/next.js/blob/canary/examples/with-redux-toolkit Will the example show the client App's (and Redux state) hydration with server data? I'm still pretty lost on how to keep my client store in sync with what is coming from the server. |
This pull request add typescript to the current redux-toolkit example on next.js. @markerikson suggested this nice idea to add a ts example: https://twitter.com/acemarke/status/1370877104527712259?s=20 This example is with the previous redux-toolkit example which was more complex. An example with the current example is available here: vercel#23249 ## Bug - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added ## Feature - [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Documentation added - [ ] Telemetry added. In case of a feature if it's used or not. ## Documentation / Examples - [ ] Make sure the linting passes
This pull request add typescript to the current redux-toolkit example on next.js. @markerikson suggested this nice idea to add a ts example: https://twitter.com/acemarke/status/1370877104527712259?s=20
This example is with the previous redux-toolkit example which was more complex. An example with the current example is available here: #23249
Bug
fixes #number
Feature
fixes #number
Documentation / Examples