react-native-top-hatting
🎩 Library that aims to help on the top-hatting process. This library is highly inspired on a post from Shopify: Top Hatting at Shopify
Installation
npm install react-native-top-hatting
Change you native host to load the bundle from tophatting library if available
@Override
protected String getJSBundleFile() {
// top-hatting return nulls if there is no js bundled loaded.
return TopHattingPackage.getJSBundleFile(MainApplication.this);
}
Usage
import {
downloadBundle,
getDownloadedBundles,
loadBundle,
} from 'react-native-top-hatting';
// ...
const downloadbundle = await downloadBundle('MyBundle1', url);
loadBundle(downloadbundle);
// restart to use the bundle loaded
Contributing
See the contributing guide to learn how to contribute to the repository and the development workflow.
License
MIT
Made with create-react-native-library