Skip to content

Commit 45f1106

Browse files
committed
define readonly getter for simulatorId
1 parent a04e9f2 commit 45f1106

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

RNAdMobBanner.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import React, { Component } from 'react';
22
import {
33
NativeModules,
44
requireNativeComponent,
5-
Platform,
65
UIManager,
76
findNodeHandle,
87
ViewPropTypes,
@@ -61,7 +60,11 @@ class AdMobBanner extends Component {
6160
}
6261
}
6362

64-
AdMobBanner.simulatorId = Platform.OS === 'android' ? 'EMULATOR' : NativeModules.RNGADBannerViewManager.simulatorId;
63+
Object.defineProperty(AdMobBanner, 'simulatorId', {
64+
get() {
65+
return NativeModules.RNGADBannerViewManager.simulatorId;
66+
},
67+
});
6568

6669
AdMobBanner.propTypes = {
6770
...ViewPropTypes,

RNPublisherBanner.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import React, { Component } from 'react';
22
import {
33
NativeModules,
44
requireNativeComponent,
5-
Platform,
65
UIManager,
76
findNodeHandle,
87
ViewPropTypes,
@@ -70,7 +69,11 @@ class PublisherBanner extends Component {
7069
}
7170
}
7271

73-
PublisherBanner.simulatorId = Platform.OS === 'android' ? 'EMULATOR' : NativeModules.RNDFPBannerViewManager.simulatorId;
72+
Object.defineProperty(PublisherBanner, 'simulatorId', {
73+
get() {
74+
return NativeModules.RNDFPBannerViewManager.simulatorId;
75+
},
76+
});
7477

7578
PublisherBanner.propTypes = {
7679
...ViewPropTypes,

0 commit comments

Comments
 (0)