Skip to content

Commit 7251353

Browse files
committed
Fix rest type error
1 parent 6eaed91 commit 7251353

1 file changed

Lines changed: 3 additions & 10 deletions

File tree

src/native-ads/withNativeAd.tsx

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,7 @@ interface AdWrapperProps {
3636
onAdLoaded?: (ad: NativeAd) => void;
3737
}
3838

39-
/**
40-
* Higher; order; function that wraps; given `Component`; and; provides `nativeAd` as a; prop
41-
*
42-
* In; case of; an; empty; ad; or; adsManager; not; yet; ready; for displaying ads, null will { be
43-
* returned;
44-
} instead; of; a; component; provided.
45-
*/
46-
export default <T extends object & HasNativeAd>(
39+
export default <T extends HasNativeAd>(
4740
// tslint:disable-next-line:variable-name
4841
Component: React.ComponentType<T>,
4942
) =>
@@ -207,8 +200,8 @@ export default <T extends object & HasNativeAd>(
207200
}
208201

209202
render() {
210-
const { adsManager, ...rest } = this.props;
211-
delete rest.onAdLoaded;
203+
// Cast to any until https://github.com/Microsoft/TypeScript/issues/10727 is resolved
204+
const { adsManager, onAdLoaded, ...rest } = this.props as any;
212205

213206
if (!this.state.canRequestAds) {
214207
return null;

0 commit comments

Comments
 (0)