Some things I noticed just from looking at the code. For one, I would maybe make a suggestion to look at @redux/toolkit. It comes prebundled with redux-thunk, and may be easier for future projects to integrate redux into an application with less boilerplate.
Secondly your mapDispatchToProps in your container I think could be simplified to just an object like so:
Additionally from my experience separating out your page components, from your other components I also find easier to manage as a project grows. An example of something like this would be how Next does their folder structure.
If there's anything specific you want looked at LMK.
I also use Typescript at work and use this method for mapDispatchToProps. Currently I'm using the @redux/toolkit which exports ActionCreatorWithPayload which is helpful for just reducing complexity. Best of luck.
Hi Binod,
Some things I noticed just from looking at the code. For one, I would maybe make a suggestion to look at
@redux/toolkit
. It comes prebundled with redux-thunk, and may be easier for future projects to integrate redux into an application with less boilerplate.Secondly your
mapDispatchToProps
in your container I think could be simplified to just an object like so:Additionally from my experience separating out your page components, from your other components I also find easier to manage as a project grows. An example of something like this would be how
Next
does their folder structure.If there's anything specific you want looked at LMK.
Hi Chris,
Thank you for review my code and give me feedback. In the case of mapDispatchToProps I have used a typescript so I apply a strict type checking.
I had tried this const mapDispatchToProps = {
getAllMovie,
getSingleMovieDetail
} This also works.
I also use Typescript at work and use this method for mapDispatchToProps. Currently I'm using the
@redux/toolkit
which exportsActionCreatorWithPayload
which is helpful for just reducing complexity. Best of luck.Thank you, Your suggestion reduces complexity. for the next project, I will apply @redux/toolkit. Once again thank you.