From 850c0bb03e01b1069a6e30650c01d853d2f33c92 Mon Sep 17 00:00:00 2001 From: Donnie West Date: Fri, 30 Jun 2017 10:32:30 -0500 Subject: [PATCH] Create an index.js file and default export (#66) With this change, consumers of this library will be able to just `import RNMail from 'react-native-mail'` instead of manually pulling the package from NativeModules. This will provide react-native-mail the same basic interface as other React Native Libraries --- README.md | 2 +- index.js | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 index.js diff --git a/README.md b/README.md index 811b414..2879936 100644 --- a/README.md +++ b/README.md @@ -97,7 +97,7 @@ public class MainApplication extends Application implements ReactApplication { ## Example ```javascript -var Mailer = require('NativeModules').RNMail; +var Mailer = require('react-native-mail'); var MailExampleApp = React.createClass({ handleHelp: function() { diff --git a/index.js b/index.js new file mode 100644 index 0000000..12be3d4 --- /dev/null +++ b/index.js @@ -0,0 +1,3 @@ +import { NativeModules } from 'react-native'; + +export default NativeModules.RNMail;