One of our goals in writing ReactXP was to enable developers to write and debug code in whatever platform environment they felt most comfortable while having confidence that the resulting code would run the same on other platforms. The same can be achieved with React Native for Web/iOS/Android, but you need to be more careful about which components, props, and APIs you use. If you write to ReactXP’s abstraction, you can have high confidence that it will run on all supported platforms in the same manner. ReactXP generally exposes only those props, style attributes, and APIs that are available across all platforms. ReactXP is a layer that sits on top of React Native and React, whereas React Native for Web is a parallel implementation of React Native - a sibling to React Native for iOS and Android. The goals behind these two efforts are similar, but the approaches differ. We started implementing ReactXP before React Native for Web was available. React Native for Web is an open-sourced library developed by engineers at Twitter. How does ReactXP differ from React Native for Web? Apps that use only ReactXP abstractions can generally avoid per-platform conditional checks. For example, Input.backButtonEvent is a no-op on iOS and the web, and StatusBar APIs are no-ops on the web. In some cases, API calls are no-ops, but they are guaranteed to be implemented. But such code will need to include build-time or run-time conditionals to avoid using these components or APIs on platforms where they don’t apply.Īll components and APIs exposed through ReactXP are implemented for all supported platforms. They can also directly access React DOM elements on the web. It also exposes some components and APIs that are not implemented in React Native, such as GestureView and UserPresence.Īpps that use ReactXP can directly access React Native components and APIs. In particular, it doesn’t expose any components that are platform-specific (such as PickerIOS or MapView). It doesn’t expose every component provided by React Native. ReactXP is neither a proper subset nor a proper superset of React Native. It also implements these same APIs, props, style attributes, and animation interfaces on the web. ReactXP generally exposes APIs, props, style attributes, and animation interfaces that are common to the React Native implementations on iOS and Android (as well as the nascent implementation on Windows). ReactXP’s components and APIs are inspired by React Native - and in most cases are the same as React Native. ReactXP is implemented in TypeScript, and the distribution includes TypeScript type definitions for the ReactXP interface. Yes, you can write your application’s code in JavaScript or any language that compiles to JavaScript (TypeScript, Flow, etc.). Other HTML5 browsers should theoretically work as well. We’ve tested ReactXP with recent versions of the following browsers: Other platforms such as Windows 7 & 8, MacOS, and Linux can be targeted using a web wrapper solution like Electron. Windows 10 – UWP (React Native) - in progress.ReactXP currently supports the following platforms:
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |