I built a simple module that export a different message if being used on node or browser/react-native environment. This is achieved by using the "browser" and "react-native" fields in package.json.
Basically I am replacing the index.js with the file I want to use in each environment.
I was testing this with a React-Native application but the behaviour is not what I expected. It doesn't use the browser version.
I have a simple app in React Native that uses that module(welcome-message) and just shows the message on the main screen.
App: https://github.com/jgalmeida/packager-test
Module: https://github.com/jgalmeida/welcome-message
Any thoughts?
Thanks!