React-native-web: Why all examples import components from 'react-native' instead of 'react-native-web'? Is it a typo or I got something wrong?

Created on 12 Apr 2017  路  1Comment  路  Source: necolas/react-native-web

For example from 'Image' component

import { Image, PropTypes, StyleSheet } from 'react-native'

Most helpful comment

The idea is that you write code importing from React-Native (so that it will run on Android / iOS), but when you're building your app for the browser, you alias the react-native module to instead point at the react-native-web module.

You can see the webpack config which enables that here

>All comments

The idea is that you write code importing from React-Native (so that it will run on Android / iOS), but when you're building your app for the browser, you alias the react-native module to instead point at the react-native-web module.

You can see the webpack config which enables that here

Was this page helpful?
0 / 5 - 0 ratings