mirror of
https://github.com/status-im/react-native-fs.git
synced 2025-02-28 15:00:29 +00:00
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:
parent
06bdba89fa
commit
ede4c7268a
17
README.md
17
README.md
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user