Write once, run anywhere with Create React (Native) App and react-native-web

Write once, run anywhere with Create React (Native) App and react-native-web

☞ 

#Native

  • npm install –save-dev babel-preset-expo jest-expo flow-bin react-native-scripts add –dev babel-preset-expo jest-expo flow-bin react-native-scripts react-test-renderer@16.2.0And we add the packages for react-native, react-native-web and expo : – npm install –save expo@^25.0.0 react-native@0.52.0 react-native-weboryarn add expo@^25.0.0 react-native@0.52.0 react-native-webNow let’s add a few files necessary to build a React Native app : – { – “presets”:…
  • flowconfig file in your project directory and add the flow settings available here – { – “expo”: { – “sdkVersion”: “25.0.0” – } – }App.test.js : this is the entry point for testing the React Native app.
  • toJSON(); – then add a App.js file, this is going to be our React Native app entry point.
  • │ – └── src – │ ├── index.js – entry point for CRA (don’t move/rename it) – │ └── … more source files – │ – └── public – ├── index.html – ├── favicon.icon – └── manifest.jsonNow let’s make a few changes to our package.json file and add some useful…
  • import React, { Component } from ‘react’ – import { View, Text, StyleSheet } from ‘react-native’export default class App extends Component { – render() { – return ( – View style={styles.app} – View style={styles.appHeader} – Text style={styles.appTitle}Welcome to React âš›ï¸�/Text – /View – Text style={styles.appIntro} – To get started, edit…

EDIT January 2018: I’ve updated this article with up to date versions (no more beta dependencies!). Thanks @KajiTetsushi for your help! 🙂 EDIT Feb 2018 : All the versions are up to date to go along…
Continue reading “Write once, run anywhere with Create React (Native) App and react-native-web”

Write once, run anywhere with Create React (Native) App and react-native-web

¡Write once, run anywhere with Create React (Native) App and react-native-web by @yannickdot

  • npm install –save-dev babel-preset-expo jest-expo flow-bin react-native-scripts add –dev babel-preset-expo jest-expo flow-bin react-native-scripts react-test-renderer@16.2.0And we add the packages for react-native, react-native-web and expo : – npm install –save expo@^25.0.0 react-native@0.52.0 react-native-weboryarn add expo@^25.0.0 react-native@0.52.0 react-native-webNow let’s add a few files necessary to build a React Native app : – { – “presets”:…
  • flowconfig file in your project directory and add the flow settings available here – { – “expo”: { – “sdkVersion”: “25.0.0” – } – }App.test.js : this is the entry point for testing the React Native app.
  • toJSON(); – then add a App.js file, this is going to be our React Native app entry point.
  • │ – └── src – │ ├── index.js – entry point for CRA (don’t move/rename it) – │ └── … more source files – │ – └── public – ├── index.html – ├── favicon.icon – └── manifest.jsonNow let’s make a few changes to our package.json file and add some useful…
  • import React, { Component } from ‘react’ – import { View, Text, StyleSheet } from ‘react-native’export default class App extends Component { – render() { – return ( – View style={styles.app} – View style={styles.appHeader} – Text style={styles.appTitle}Welcome to React âš›ï¸�/Text – /View – Text style={styles.appIntro} – To get started, edit…

EDIT January 2018: I’ve updated this article with up to date versions (no more beta dependencies!). Thanks @KajiTetsushi for your help! 🙂 EDIT Feb 2018 : All the versions are up to date to go along…
Continue reading “Write once, run anywhere with Create React (Native) App and react-native-web”

Why and When Cordova is better then React Native ? – codeburst

Why and When Cordova is better then #reactnative ?

  • Your project is both web and mobile application.With Cordova Wrapper you can build a hybrid application reusing the website codebase.
  • DOCTYPE htmlhtmlhead meta charset=”utf-8″ //headbody% if %script src=”cordova.js”/script% } %/body/htmlInside the codebase, we can check weather its a cordova app(mobile app) by checking window.cordova object and calling native functions.if(window.cordova){ approach which is pretty awesome is to have one single web application, which will be accessed both by web-browsers and mobile…
  • Using Cordova, we create TV apps for seat-back screens that provide passengers with a set menu of the in-flight entertainment system.Nevertheless, React Native is targeting Android and iOS platforms.Cordova Platform If you need a native-like performance of your app why use React-Native, and if you don’t, why use it anyway?If…
  • Neither Cordova nor React Native is a native application and cannot compete with real native apps.
  • Since JavaScript is single threaded, we may have trouble running our React Native or Cordova application.

I have three years’ of experience as a JavaScript app developer and I am working both with React-Native and Cordova wrapper. And I once again concluded that there is no such thing as ‘the perfect…
Continue reading “Why and When Cordova is better then React Native ? – codeburst”

Wait. What is React Native Again?

Wait. What is React Native Again?   #reactNative

  • Overall, React Native has allowed our teams to build native apps in technology we understand, using tools we know and love.
  • One of our projects involved a re-write of an existing mobile application in Cordova.
  • Not only is React Native an extremely powerful tool for developing cross-platform applications in JavaScript, it’s very easy to learn for any Javascript developer with React knowledge .
  • When using a tool like Cordova, you write the majority of your business logic and UI in JavaScript.
  • React Native is a set of tools and libraries that allows developers to write React Components that generate genuine native interfaces.

As part of our consulting process here at Differential, we often determine that a mobile app would be a good fit for our clients. Most of the time Android and iOS support is desirable, and dedicating development resources to building a native experience for both platforms is very resource intensive. We’ve skirted around this issue in the past, mostly by using Cordova, which lets us write HTML, CSS, and JS to create cross-platform apps. Cordova works great for the most part, but we discovered that you can only go so far when using web technology to create apps that feel truly native.
Continue reading “Wait. What is React Native Again?”