question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Hi!, I’m trying to use this lib from react-native with typescript. unfortunately ‘npm run tsc’ will complain about AbortController:

node_modules/react-async/dist-types/index.d.ts:333:71 - error TS2304: Cannot find name 'AbortController'.
 
333 export declare type PromiseFn<T> = (props: AsyncProps<T>, controller: AbortController) => Promise<T>;

Any ideas how to solve this?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
ghengeveldcommented, Jan 9, 2020

Maybe we should document this somewhere? @jakabjack could you maybe open a PR for that?

1reaction
jakabjackcommented, Jan 9, 2020

found a solution: add another line to afile.d.ts: type AbortController = typeof Object;

Read more comments on GitHub >

github_iconTop Results From Across the Web

AbortController - Web APIs | MDN
The AbortController interface represents a controller object that allows you to abort one or more Web requests as and when desired.
Read more >
The complete guide to AbortController in Node.js
AbortController API involves passing the ; signal property to any cancelable asynchronous API. You can pass the same ; signal property to as...
Read more >
AbortController & AbortSignal | Can I use... Support ... - CanIUse
Controller object that allows you to abort one or more DOM requests made with the Fetch API. Usage % of. all users, all...
Read more >
Fetch: Abort - The Modern JavaScript Tutorial
AbortController is a simple object that generates an abort event on its signal property when the abort() method is called (and also sets...
Read more >
AbortController | typescript - v3.7.7
Interface AbortController. A controller object that allows you to abort one or more DOM requests as and when desired.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found