我已经开始学习React出于好奇,想知道React和React Native之间的区别-虽然不能找到一个满意的答案使用谷歌。React和React Native似乎有相同的格式。它们的语法完全不同吗?
当前回答
React是一个用于构建用户界面的JavaScript库。它用于重用UI组件。 React Native是一个JavaScript框架,用于为iOS和Android编写真实的原生渲染移动应用程序。 两者都是由facebook开发的,它们共享相同的生命周期方法。
其他回答
React-Native是一个用于开发Android和iOS应用程序的框架,它共享80% - 90%的Javascript代码。
而React.js是用于开发web应用程序的父Javascript库。
当你在React-Native中使用像<View>, <Text>这样的标签时,React.js使用像<div> <h1> <h2>这样的web html标签,这只是web/移动开发词典中的同义词。 对于React.js,你需要DOM来渲染html标签的路径,而对于移动应用程序:React-Native使用AppRegistry来注册你的应用程序。
我希望这是一个简单的解释React.js和React-Native的快速差异/相似之处。
在Reactjs中,虚拟DOM用于在Reactjs中渲染浏览器代码,而在React Native中,本地api用于渲染移动设备中的组件。
用Reactjs开发的应用程序在UI中渲染HTML,而React Native使用JSX来渲染UI,这只是javascript。
反应
React is used for creating websites, web apps, SPAs etc. React is a Javascript library used for creating UI hierarchy. It is responsible for rendering of UI components, It is considered as V part Of MVC framework. React’s virtual DOM is faster than the conventional full refresh model, since the virtual DOM refreshes only parts of the page, Thus decreasing the page refresh time. React uses components as basic unit of UI which can be reused this saves coding time. Simple and easy to learn. React Native React Native is a framework that is used to create cross-platform Native apps. It means you can create native apps and the same app will run on Android and ios. React native have all the benefits of ReactJS React native allows developers to create native apps in web-style approach.
React Js是一个Javascript库,你可以使用React开发和运行更快的web应用程序。
React Native让你只使用JavaScript构建移动应用程序,它用于移动应用程序开发。更多信息请点击这里https://facebook.github.io/react-native/docs/getting-started.html
React is a framework for building applications using JavaScript. React Native is an entire platform allowing you to build native, cross-platform mobile apps, and React.js is a JavaScript library you use for constructing a high performing UI layer. React.js is the heart of React Native, and it embodies all React’s principles and syntax, so the learning curve is easy. The platform is what gave rise to their technical differences. Like the browser code in React is rendered through Virtual DOM while React Native uses Native API’s to render components on mobile. React uses HTML and with React Native, you need to familiarize yourself with React Native syntax. React Native doesn’t use CSS either. This means you’ll have to use the animated API which comes with React Native to animate different components of your application.
最重要的是,React是为你的web界面构建动态,高性能,响应性UI的理想选择,而React Native是为了给你的移动应用程序一个真正的原生感觉。
雷夫:what-is-the-difference-between-react-js-and-react-native
推荐文章
- 给一个数字加上st, nd, rd和th(序数)后缀
- 如何以编程方式触发引导模式?
- setTimeout带引号和不带括号的区别
- 在JS的Chrome CPU配置文件中,'self'和'total'之间的差异
- 用javascript检查输入字符串中是否包含数字
- 如何使用JavaScript分割逗号分隔字符串?
- 在Javascript中~~(“双波浪号”)做什么?
- 谷歌chrome扩展::console.log()从后台页面?
- 未捕获的SyntaxError:
- [].slice的解释。调用javascript?
- jQuery日期/时间选择器
- 我如何预填充一个jQuery Datepicker文本框与今天的日期?
- npm犯错!代码UNABLE_TO_GET_ISSUER_CERT_LOCALLY
- 数组的indexOf函数和findIndex函数的区别
- 反应-显示加载屏幕,而DOM是渲染?