on-tour-mobile-modules v4.0.1
OnTour Mobile Application Shared Files
Any files used by two or more of the OnTour mobile applications should be moved to this package
!Warning!
This package uses ES6 import/export syntax, so if you do not use a suitable bundler/transpiler, you're gonna have a bad time.
Usage
- Install from the public
npm
registry in the host project by runningyarn add on-tour-mobile-modules
import
the necessary named exports as usual. Example:
import { ErrorBoundary, Loader, LoginButton } from "on-tour-mobile-modules"
Adding New Components
When adding new components, be sure to give them a testID so that they can be picked up by the automated tests. The naming convention should be the same as the exported component name. For example the LoginButton component should have a testID of 'LoginButton'.
Building
mobile-shared-modules
exclusively utilizes yarn
for dependency management (don't have yarn
installed? See Installing yarn
below.).
1. Run yarn
from your favorite terminal (or IDE)
Troubleshooting
You may run into issues with the metro bundler complaining about duplicate
module names. For instance, this package uses react-native
, react-animated
,
etc. So any project that imports this package and already uses these libraries
may have difficulties. To get around this, you can add a file called
rn-cli.config.js
to the root directory and paste in the following code:
const blacklist = require('metro-config/src/defaults/blacklist');
module.exports = {
resolver: {
blacklistRE: blacklist([
/node_modules\/.*\/node_modules\/react-native\/.*/,
])
},
};
Installing yarn
Follow the instructions outlined in the official yarn
docs
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago