Merge commit '54c92d0640e8765e4ab3d624dc1577bcc4ed7bfa'
This commit is contained in:
commit
31e78c8709
|
@ -13,13 +13,26 @@ const adMobPropTypes = {
|
|||
unitId: PropTypes.string.isRequired,
|
||||
request: PropTypes.object,
|
||||
video: PropTypes.object,
|
||||
};
|
||||
Object.keys(EventTypes).forEach((eventType) => {
|
||||
adMobPropTypes[eventType] = PropTypes.func;
|
||||
});
|
||||
Object.keys(NativeExpressEventTypes).forEach((eventType) => {
|
||||
adMobPropTypes[eventType] = PropTypes.func;
|
||||
});
|
||||
|
||||
const nativeComponents = {};
|
||||
|
||||
function getNativeComponent(name) {
|
||||
if (nativeComponents[name]) return nativeComponents[name];
|
||||
const component = requireNativeComponent(name, AdMobComponent, {
|
||||
nativeOnly: {
|
||||
onBannerEvent: true,
|
||||
},
|
||||
});
|
||||
nativeComponents[name] = component;
|
||||
return component;
|
||||
}
|
||||
Object.keys(EventTypes).forEach(eventType => {
|
||||
adMobPropTypes[eventType] = PropTypes.func;
|
||||
});
|
||||
Object.keys(NativeExpressEventTypes).forEach(eventType => {
|
||||
adMobPropTypes[eventType] = PropTypes.func;
|
||||
});
|
||||
|
||||
class AdMobComponent extends React.Component {
|
||||
static propTypes = adMobPropTypes;
|
||||
|
@ -36,11 +49,7 @@ class AdMobComponent extends React.Component {
|
|||
height: 0,
|
||||
};
|
||||
|
||||
this.nativeView = requireNativeComponent(props.class, AdMobComponent, {
|
||||
nativeOnly: {
|
||||
onBannerEvent: true,
|
||||
},
|
||||
});
|
||||
this.nativeView = getNativeComponent(props.class);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue