- React The idea of functional programming makes the code more elegant and reasonable
- Rigorous one-way data flow design , Easy to build large, complex and stable single page applications
- A rich technology ecosystem , Technology support from all over the world
- It's convenient to cooperate ReactNative Develop cross terminal applications
React Functional programming makes code more elegant and reasonable
Functional programming is programming with a combination of functions , Declare function first , And then call the function. , Each step has a return value , Abstract by extracting each step of logical operation , Encapsulated in functions . Then combine the functions to write the program . for example ： Calculate the average percentage , We can split it into three functions , One is to calculate the average , One is to calculate the percentage , One is a function called synthetically , By nesting functions , Make the code more elegant , Better for reuse .
React Use the idea of functional programming to make the code more elegant and reasonable , More conducive to componentization 、 Modular development .React Every component of is function generation , The essence of the page rendering process is the nested function calling process .React This design is very convenient for use , For example, the following subcomponents nest subcomponents and then nested subcomponents ： The nested subcomponent call pattern in a subcomponent is always the same . When a parent component calls a child component, it only needs to consider the parameters passed props, The subcomponents only need to consider the parameters passed in .
Rigorous one-way data flow design , Easy to build large, complex and stable single page applications
React The data flow is always designed in one direction , Strictly follow data driven DOM. The advantage of this is , Reduce the code coupling of components communicating with each other , The data flow is clearer , Debugging is more convenient . Large scale complex single page applications have always been a problem for enterprises , The traditional way of development can not be well maintained . While using React Based on the technology stack , It's easy to split modules 、 Components , Combined with Redux Data flow management , It can build applications efficiently . The fact proved that , such React、Redux Large complex single page project construction scheme , It has been applied and developed in major Internet companies .
A rich technology ecosystem , Technology support from all over the world
React By Facebook High quality modern front-end framework developed by the company , With high authority and professionalism , Supported by the major technology communities around the world , Including the domestic technology community . such as ,npm Official website 、 TaoBao cnpm Communities and so on are rich in ecology . A lot of developers work together , Open source sharing , Enriching the technology ecosystem , Make it easy for us to learn and use based on React The components of 、 plug-in unit , Reduce development costs , Improve development efficiency . At home , Developed by Alibaba based on React Basic development Antd Component library is well received by Internet enterprises , Open the box , In order to accelerate the development of small and medium-sized enterprises in China 、 Informatization has played an important role .
It's convenient to cooperate ReactNative Develop cross terminal applications
An important problem for Internet companies is ： How to reduce costs 、 Efficient cross terminal application development . in other words , Internet companies want to be able to develop iOS、Android、H5 application .React coordination ReactNative Library can easily develop cross terminal applications .ReactNative Design principle and React Agreement , Used React Technology stack , You've got the foundation , Combined with ReactNative You can have a code , Compile to generate multiterminal applications .ReactNative Convenient for many companies to develop quickly and efficiently App, Reduce R & D costs , Increased productivity , Reduced development time .
React、Vue Development trend
React More emphasis on functional programming . From now on 16.7 After the version , There is Hook The idea of function hook , Can only be React Only functional components can be used . This characteristic is obvious ,React I hope to make full use of functional programming , Better and better project development . Interestingly , It's here useMemo function , It's like Vue Medium computed The role of , here React It's a reference Vue The dynamic listening mode of variables .
React、Vue The trend shows that , The two frameworks draw on each other , Learn from others' strong points and close the gap , All for better application development .
How to choose the right framework
face React、Vue, How should we choose . Here are some ideas ：
- Small projects are more important, and if they are, they are UI show , More style development , Recommended Vue. Develop Vue The advantages of template styles .
- With complex data logic applications, such as the China Taiwan chemical project , It is recommended to use React. The pattern of one-way data flow can avoid data logic errors .
- Large complex single page project , recommend React. In combination with Redux、Mbox Wait for the status management library , Componentization 、 Modular development , Effective management .
At the end
React、Vue All excellent front end frames , Each has its own place .React Framework of functional programming concept 、 Rigorous one-way data flow design 、 Rich technology ecosystem and convenient development of cross terminal applications have greater advantages . We have to use it according to the scenario 、 Business needs 、 Technology implementation and other comprehensive factors to choose the most suitable framework , To give full play to the greatest advantage , raise productivity .
So much for this issue , I'm Xiaobian. The wind blows from the south , Focus on sharing, fun and fun 、 novel 、 Practical open source projects and developer tools 、 Learning resources ！
I hope to learn and communicate with you , Welcome to my official account. 【Github Navigation station 】.