Next up ● Quick Intro to ReactJS ● Moving from ReactJS to React Native ● My secret awesome app called #insert-app-name# ● Using React Native in #insert-app-name# ● Final thoughts
Motivation ● Problem: Facebook.com’s constant mutating DOM ● Solution: ○ Don’t modify DOM, just declare state changes ○ Use well defined components with clear contracts
Building Native Modules (No UI) ● Build / take a native component in Android / iOS ● Write the a native wrapper to expose it to javascript ○ Expose methods by annotating with @ReactMethod ○ Visual component? Implement createViewInstance (ThemedReactContext context) ● Create a ReactPackage that describes all your components ● Write a javascript component shim file ● Use javascript component as you would any other React component
Parting thoughts: ● ReactJS is actually pretty awesome ● Some React Native components are not as performant out of the box ○ List controls don’t implement item recycling ● React Native setup was a little painful but worth it (maybe) ○ Currently chatscript code is shared between web and native app ○ Development time is much faster: Hot reload of JS vs native compile