grabcode / react-native-web-starter

Starter for a React Native for Web project (RN4Web)
Other
228 stars 36 forks source link

cannot use third-party react native components #12

Open anchetaWern opened 8 years ago

anchetaWern commented 8 years ago

Not sure if this is a problem with the starter kit or the react native for web project itself but I can't get any react native package to work. Here are a few one's that I tried:

Looking at the source code for each one, I don't think any of these has links to the native platform so I'm not sure why it wouldn't work.

There are two kinds of errors that shows up in the console whenever I import a react native package:

Uncaught Error: Cannot find module "react-native-grid-component"
bundle.js: Uncaught SyntaxError: Unexpected token import

Specifically, it's complaining about this line:

import Row from './Components/Row';

It seems it doesn't know where to load the files. I got it when I tried to use react native easy grid

Also whenever I try to install a package I always get this error:

UNMET PEER DEPENDENCY file-loader@*

That's why I installed file-loader

But there's also this error:

UNMET PEER DEPENDENCY react-native@>=0.33.0

I got the above error when I tried to install lodash and react-native-grid-component. But the only library that I got to work is lodash.

Is this expected? the only npm packages that would work are the one's that can be used in the browser and node.js?

Let me know if you need more details, thanks!