< All FAQs

What sort of code can I reuse? – NativeScript

Because NativeScript runs JavaScript code, you have the potential to reuse JavaScript and TypeScript code that you run in your web apps. Not all JavaScript will run, as NativeScript does not use HTML or the DOM; therefore libraries such as jQuery do not work.

But code that doesn’t touch the user interface, such as backend services, and utility modules such as lodash, underscore, and moment work in NativeScript exactly as they do in a web app. The story gets even better if you use Angular 2 in NativeScript, as you can code to the same APIs in your web and native apps.

And it gets even better. In addition to web code reuse, NativeScript also gives you the ability to leverage native iOS and Android frameworks when building your native apps. You can learn more by reading our documentation on plugins and CocoaPods.

NativeScript is licensed under the Apache 2.0 license
© 2020 All Rights Reserved.