mirror of
https://github.com/status-im/react-native-fs.git
synced 2025-02-28 23:10: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
@ -42,6 +42,8 @@ dependencies {
|
|||||||
|
|
||||||
* register module (in MainActivity.java)
|
* register module (in MainActivity.java)
|
||||||
|
|
||||||
|
* For react-native below 0.19.0 (use `cat ./node_modules/react-native/package.json | grep version`)
|
||||||
|
|
||||||
```java
|
```java
|
||||||
import com.rnfs.RNFSPackage; // <--- import
|
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
|
## Examples
|
||||||
|
|
||||||
### Basic
|
### Basic
|
||||||
|
Loading…
x
Reference in New Issue
Block a user