Commit 4214f396 authored by Rebecca Hughes's avatar Rebecca Hughes

Update documentation for RN 0.18+

parent bc435a72
...@@ -44,6 +44,29 @@ dependencies { ...@@ -44,6 +44,29 @@ dependencies {
* register module (in MainActivity.java) * register module (in MainActivity.java)
On newer versions of React Native (0.18+):
```java
import com.learnium.RNDeviceInfo.*; // <--- import
public class MainActivity extends ReactActivity {
......
/**
* A list of packages used by the app. If the app uses additional views
* or modules besides the default ones, add more packages here.
*/
@Override
protected List<ReactPackage> getPackages() {
return Arrays.<ReactPackage>asList(
new RNDeviceInfo(), // <------ add here
new MainReactPackage());
}
}
```
On older versions of React Native:
```java ```java
import com.learnium.RNDeviceInfo.*; // <--- import import com.learnium.RNDeviceInfo.*; // <--- import
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment