简体   繁体   中英

React: Beginner friendly design pattern for React, MVVM or Redux?

I am a beginner of React, plan to start some side projects to advance my skills. Which design pattern is more beginner-friendly to start with, Redux or MVVM? Useful links or tutorials are highly appreciated. Thanks!

In my experience, React + Redux is a pretty beginner-friendly and killer combination when it comes to building web-apps.

I can highly suggest trying out Redux with the React framework Gatsby.

Here's how to get started in no time: https://www.freecodecamp.org/news/how-to-get-started-with-gatsby-2-and-redux-ae1c543571ca/

Please note that most tutorials for Redux out there show an outdated style of Redux we no longer really recommend to use in new applications. Best follow the official tutorials at https://redux.js.org/tutorials/index to learn modern Redux. If you follow anything else, make sure it uses the official redux toolkit and hooks.

In general: if you are following any React tutorial and it spends time on class components, it is probably pretty outdated. Hooks in function components are around for a few years now and pretty much where the ecosystem has ended up - you will probably only encounter class components in legacy projects.

Also note, though, that we recommend first learning React and then learning Redux when it is really necessary. You don't really need any external state management library in the beginning, and you also should probably not try to apply any classical design patterns onto React. React has it's own way of doing things and most design patterns really don't fit it very well. So... just learn the framework and see how it feels? :)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM