ManuelDeLeon / viewmodel-react

Create your React components with view models.
MIT License
24 stars 3 forks source link

[React Native] navigator.project === 'ReactNative' insufficient. #15

Open iwasaki-kenta opened 7 years ago

iwasaki-kenta commented 7 years ago

Hi,

After importing the babel polyfill and updating to the latest ViewModel to test on React Native, it seems that navigator.project is always undefined.

An alternative solution recommended is checking if React.View exists: http://stackoverflow.com/a/31738222/4589486

Temporary workaround:

index.android.js

import "babel-polyfill";

import React from "react";
import {AppRegistry} from "react-native";
import Root from "./app";

navigator.project = "ReactNative";

AppRegistry.registerComponent('Cheatsheet', () => Root);

Regards, Kenta Iwasaki

ManuelDeLeon commented 7 years ago

Thx . I'll update it tomorrow.

On Oct 26, 2016 11:32 PM, "Kenta Iwasaki" notifications@github.com wrote:

Hi,

After importing the babel polyfill and updating to the latest ViewModel to test on React Native, it seems that navigator.project is always undefined.

An alternative solution recommended is checking if React.View exists: http://stackoverflow.com/a/31738222/4589486

Regards, Kenta Iwasaki

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/ManuelDeLeon/viewmodel-react/issues/15, or mute the thread https://github.com/notifications/unsubscribe-auth/AED31u23Ap-3JQR1mGGyNenvYuGJfMIpks5q4DdbgaJpZM4Kh9Wq .