react 库_立即学习React库的5个理由

沈成天
2023-12-01

react 库

在2020/2021年成为JavaScript开发人员的必备技能(Must-Have Skill as a JavaScript Developer in 2020/2021)

There are more than 50,000 job openings to React in the USA alone! Moreover, the demand for react developers isn’t showing any decline.

仅在美国,就有超过50,000个职位空缺到React! 而且,对React开发人员的需求没有显示任何下降。

React js is indeed a high paying skill to learn in 2020/2021, for which there is a lot of demand and less supply. With the dawn of a single page application, I don't see we are going to see React Js going anywhere in this decade.

React js确实是在2020/2021中学习的一项高薪技能,因为需求量很大而供应却较少。 随着单页面应用程序的兴起,我看不到我们将在这个十年中看到React Js出现在任何地方。

But what makes React so popular and wanted and why you need to learn or use React in your next project? We are going to find answers in this post.

但是,什么使React如此受欢迎和想要呢?为什么在下一个项目中需要学习或使用React? 我们将在这篇文章中找到答案。

React is a JavaScript library primarily used for building amazing user interfaces in a short time. There are other libraries that serve the same purpose, but React is in the competition of its own. It is super easy and lightweight. You can start using react in 5 days.

React是一个JavaScript库,主要用于在短时间内构建出色的用户界面。 还有其他的库也可以达到相同的目的,但是React本身就是竞争者。 它超级简单轻便。 您可以在5天内开始使用react。

React works with reusable components, that leads to way less code. There are already tons of Components readily available, you just need to download and plugin, super easy!

React与可重用的组件一起工作,从而减少了代码量。 已经有大量的组件可供使用,您只需要下载和插件,超级简单!

The same thing built with pure JavaScript is tougher and time-consuming and the worst of all your code won’t have a robust structure.

使用纯JavaScript构建的同一事物更加艰巨且耗时,并且最糟糕的代码将没有健壮的结构。

Which companies in the world are using React Js

世界上哪些公司正在使用React Js

WhatsApp, Facebook, Tesla, Reddit, Paypal, Twitter, Netflix, and the list keeps going.

WhatsApp,Facebook,Tesla,Reddit,Paypal,Twitter,Netflix,并且列表还在不断增加。

Here are the top reasons why you should consider using React JS over other JavaScript libraries.

这是为什么您应该考虑在其他JavaScript库上使用React JS的主要原因。

1.易于学习和使用 (1. Easy to learn and use)

React comes with a user-friendly and easy to understand JavaScript documentation, I love the documentation as much as react. You will easily grasp the components right away even without guidance from another developer. It is super easy!

React附带了一个用户友好且易于理解JavaScript文档,我非常喜欢React。 即使没有其他开发人员的指导,您也可以立即轻松地掌握组件。 超级容易!

React uses plain JavaScript and its lifecycle is clearly defined. It is easy and to use the component-based approach to build your website or mobile application. The simplicity of React makes it preferred to the complex Angular framework and Ember.

React使用普通JavaScript,并且明确定义了其生命周期。 这很容易,并且可以使用基于组件的方法来构建您的网站或移动应用程序。 React的简单性使其成为复杂的Angular框架和Ember的首选。

2.可重复使用的组件 (2. Reusable♻ components)

React JS uses a component-based structure that enables you to start with small components and progress to large components.

React JS使用基于组件的结构,使您可以从小型组件开始,然后发展为大型组件。

For instance, you can start with small components like dropdown, button, or checkbox and then use them to create large wrapper components. You progress from one level of wrapper component to a higher level until you achieve one root component. The root component is your mobile application.

例如,您可以从下拉列表,按钮或复选框之类的小组件开始,然后使用它们创建大型包装器组件。 您需要从一个包装器组件级别升级到更高的级别,直到获得一个根组件为止。 根组件是您的移动应用程序。

Each component on React JS has a unique internal logic that determines how the component is rendered.

React JS上的每个组件都有一个独特的内部逻辑,该逻辑确定组件的呈现方式。

The major advantage of components on this JavaScript library is that you can re-use them on any platform. Consequently, your app or website will have the same outlook on all platforms.

该JavaScript库中组件的主要优点是您可以在任何平台上重复使用它们。 因此,您的应用程序或网站在所有平台上的外观都相同。

Re-usable components simplify the app development process. Also, re-usable codes enable you to grow and maintain your codebase fast.

可重用组件简化了应用程序开发过程。 此外,可重用代码使您能够快速增长和维护代码库。

3.使用虚拟DOM进行快速的渲染 (3. Fast⚡ rendering with virtual DOM)

One of the top considerations when choosing a programming framework is performance. The consideration is important if you are developing a mobile application that will involve high user interactions and constant updates.

选择编程框架时的首要考虑因素之一是性能。 如果要开发将涉及大量用户交互和不断更新的移动应用程序,则考虑因素很重要。

Many JavaScript libraries can create complex applications, but their DOM (Document Object Model) manipulations are slow. Web Developers can overcome the challenge of updating DOM by choosing React JS.

许多JavaScript库可以创建复杂的应用程序,但是它们的DOM(文档对象模型)操作速度很慢。 Web开发人员可以通过选择React JS来克服更新DOM的挑战。

In React, for every DOM object, there is a corresponding virtual DOM object. A virtual DOM object is a representation of a DOM object, like a lightweight copy.

在React中,对于每个DOM对象,都有一个对应的虚拟DOM对象。 虚拟DOM对象是DOM对象的表示形式,例如轻量级副本。

A virtual DOM object has the same properties as a real DOM object, but it lacks the real power to directly change what’s on the screen.

虚拟DOM对象具有与真实DOM对象相同的属性,但是它缺乏直接更改屏幕上内容的真正能力。

Manipulating the DOM is slow. Manipulating the virtual DOM is much faster because nothing gets drawn onscreen.

操作DOM很慢。 操作虚拟DOM的速度更快,因为屏幕上没有任何内容。

Think of manipulating Virtual DOM like changing the map or blueprint of your room furniture as opposed to changing the actual furniture in the room.

想想如何将虚拟DOM操作像更改房间家具的地图或蓝图,而不是更改房间中的实际家具。

4.Easy可以单独或批量更新组件 (4. Easy to update components, individually or in bulk)

ReactJS also allows you to quickly iterate on any element. You want to modify the color of all buttons throughout the website? A few seconds and it’s done. Want to stop redirecting from each case study to an outdated landing page? Swapping all the old links with the new ones is a breeze. Of course, if you wish to only modify one or a few components, you can do it without affecting any other elements of your project.

ReactJS还允许您快速迭代任何元素。 您要修改网站上所有按钮的颜色吗? 几秒钟就完成了。 是否要停止从每个案例研究重定向到过时的登录页面? 将所有旧链接替换为新链接很容易。 当然,如果您只希望修改一个或几个组件,则可以在不影响项目其他任何元素的情况下进行修改。

The logic behind each component can be defined by a developer once and React will just use it to display elements exactly where we want them to be, across the entire project. Maintaining the code base a lot easier with React!

每个组件背后的逻辑都可以由开发人员定义一次,React只会使用它来在整个项目中准确显示元素的位置。 用React维护代码库要容易得多!

5. React Native (5. React Native)

Learning React comes with a bonus: React Native. React is not “write once use anywhere” as the creators say but it is more like learn once use everywhere library.

学习React有一个额外的好处: React Native 。 正如创建者所说的那样,React并不是“在任何地方都可以编写一次”,而是更像是“在任何地方都可以使用一次学习”。

Yes, you can write native apps for Android and iOS using React Native. Although you will not be able to use the exact same code you wrote for the web, you will be able to use the same methodology and the same architecture.

是的,您可以使用React Native为Android和iOS编写本机应用程序。 尽管您将无法使用与为Web编写的代码完全相同的代码,但是您将能够使用相同的方法和相同的体系结构。

Please note that I have only talked about the positive aspects of React and not the negatives. Yes, there are some problems with react which we will talk about in another post, but one thing is sure React is amazing.

请注意,我只谈论了React的积极方面,而不是消极方面。 是的,react存在一些问题,我们将在另一篇文章中进行讨论,但是有一点可以肯定,React非常出色。

React is phenomenal not only in the job perspective but also it is pleasurable for the developer who works with it.

React不仅在工作方面令人印象深刻,而且对于使用它的开发人员来说也是令人愉悦的。

Anyone asks me what front-end framework to learn, I always recommend React. Yes, there are other alternatives but React is the better!

有人问我要学习什么前端框架,我总是推荐React。 是的,还有其他选择,但是React更好!

More to read…

更多阅读...

翻译自: https://medium.com/swlh/5-reasons-to-learn-react-library-right-now-1f37c1c0b796

react 库

 类似资料: