Quantcast
Channel: Active questions tagged react-native+typescript - Stack Overflow
Viewing all articles
Browse latest Browse all 6214

Extends Console Interface for TypeScript

$
0
0

I would like to add an object in the window.console global.

import Reactotron from 'reactotron-react-native';window.console.tron = Reactotron;

Although when I do that, TypeScript complains about the new object:

error TS2339: Property 'tron' does not exist on type 'Console'.

I was thinking to extends the Console interface:

interface ConsoleWithTron extends Console {  tron: any};

Although, I'm not sure how to assign this new interface to my global console object?

Help would be great!

Thanks.


Viewing all articles
Browse latest Browse all 6214

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>