Update Readme.md re: new react-native version

react-native now uses `getPackages()` to return an array of package objects instead of overriding `onCreate()`.
This commit is contained in:
Scott M. M. Jackson 2016-02-07 10:51:17 -05:00
parent 06bdba89fa
commit ede4c7268a

View File

@ -41,6 +41,8 @@ dependencies {
```
* register module (in MainActivity.java)
* For react-native below 0.19.0 (use `cat ./node_modules/react-native/package.json | grep version`)
```java
import com.rnfs.RNFSPackage; // <--- import
@ -74,6 +76,21 @@ public class MainActivity extends Activity implements DefaultHardwareBackBtnHand
}
```
* For react-native 0.19.0 and higher
```java
import com.rnfs.RNFSPackage; // <------- add package
public class MainActivity extends ReactActivity {
// ...
@Override
protected List<ReactPackage> getPackages() {
return Arrays.<ReactPackage>asList(
new MainReactPackage(), // <---- add comma
new RNFSPackage() // <---------- add package
);
}
```
## Examples
### Basic