Denis Molodtsov
Denis Molodtsov

Reputation: 824

NativeModules is always empty. Visual Studio Code + Windows for iOS?

I am wondering if there are any developers who develop for iOS using react-native using Windows. I have a burning suspicion that there are none. The reason I think that is that I could not find a single example where someone can access the file system of the iOS device with the following development setup:

There are similar questions, but there are no answers that actually work for Windows + VSCode:

Can someone, please explain if it's possible to use NativeModules, for example when using react-native-fs with Visual Studio Code + Windows? I've seen dozens examples with MacOs or XCode, but I'm not using either of these. I've got VSCode + Windows 10 + Expo app.

Details:

> react-native link react-native-fs

Scanning folders for symlinks in D:\Delete\o365app\nodemodules (65ms)_

For some reason, require('react-native').NativeModules contains an empty {} object:

More info:

I'm probably missing something basic or obvious, but what is it? Can someone point me to an article or to the example that actually works with Windows+VSCode+Expo app, please?

Upvotes: 3

Views: 290

Answers (1)

Denis Molodtsov
Denis Molodtsov

Reputation: 824

Sad news for those using Windows and react-native.

We cannot develop iOS apps using Windows. I mean none of the native modules are available when using Windows. Basically, you can toy around a little bit on Windows, but you can't develop any real apps.

When you eject react-native app using yarn run --> eject there is no way to eject the app for iOS. This is what I get when ejecting on Windows:

Skipping iOS because you are not running macOS.

Upvotes: 1

Related Questions