From 585419bc15302aff3be2d31b4a57b0f159cc1542 Mon Sep 17 00:00:00 2001 From: wookiem Date: Sun, 29 May 2016 09:38:52 -0400 Subject: [PATCH] Add support for React Native 25+. Breaking change -- won't work with prior releases. --- README.md | 2 ++ index.ios.js | 8 +++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 3f4e443..486bf00 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,8 @@ Note: this project is under development and functionality will improve over time npm install react-native-file-download --save ``` +## Breaking change -- Now supports React Native v25+. Not compatible with prior versions. You can continue using older versions of React Native with react-native-file-download@0.0.9. + ## Getting started - iOS 1. In XCode, in the project navigator right click `Libraries` ➜ `Add Files to [your project's name]` diff --git a/index.ios.js b/index.ios.js index 2fb9961..aa6fe4e 100644 --- a/index.ios.js +++ b/index.ios.js @@ -1,8 +1,10 @@ 'use strict' -var React = require('react-native') -var RNFileDownload = React.NativeModules.RNFileDownload -var NativeAppEventEmitter = React.NativeAppEventEmitter +import { + NativeModules, + NativeAppEventEmitter +} from 'react-native'; +var RNFileDownload = NativeModules.RNFileDownload; var promisify = require("es6-promisify") let progressEventName = 'RNFileDownloadProgress'