Skip to content

Commit 693bdad

Browse files
committed
Change the way module is exported
1 parent a31085c commit 693bdad

File tree

4 files changed

+22
-8
lines changed

4 files changed

+22
-8
lines changed

index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
export default * from './src';
1+
import Index from './src/index';
2+
3+
export default Index;

src/index.android.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
class AppStoreReview {
2+
3+
static requestReview() {
4+
console.error('RNAppStoreReview is only available on iOS for now.');
5+
}
6+
7+
}
8+
9+
export default AppStoreReview;

src/index.ios.js

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,15 @@ import { NativeModules } from 'react-native';
22

33
const { RNAppStoreReview } = NativeModules;
44

5-
export function requestReview(appIdentifier) {
6-
if (!RNAppStoreReview) {
7-
throw new Error('RNAppStoreReview library seems to be not linked to your project...');
5+
class AppStoreReview {
6+
7+
static requestReview(appIdentifier) {
8+
if (!RNAppStoreReview) {
9+
console.error('RNAppStoreReview library seems to be not linked to your project...');
10+
}
11+
return RNAppStoreReview.requestReview(appIdentifier);
812
}
9-
return RNAppStoreReview.requestReview(appIdentifier);
13+
1014
}
15+
16+
export default AppStoreReview;

src/index.js

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)