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.

Full Typescript Support

See original GitHub issue

🚀 Feature Proposal

a loadable component should inheritance props from original component

Motivation

currently when using loadable components types get lost and you lose some advantages of TS

React.lazy currently works with this feature as expected

Example

lets say that OriginalComponent accepts props a and b when doing:

 OtherComponent = loadable(() => import('./OriginalComponent'))

OtherComponent should inheritance those props and work with autoComplete or throw errors if there is a missing prop

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5

github_iconTop GitHub Comments

3reactions
atnpcgcommented, Feb 5, 2021

you’re right @theKashey, I never installed types, because the package already have some typescript so the compiler does not ask for it. btw @types/loadable does not exist but @types/loadable__component does the trick. probably a good idea to update docs to mention this?.

1reaction
theKasheycommented, Feb 6, 2021

Probably it’s time to autoinstall these missing types.

Read more comments on GitHub >

github_iconTop Results From Across the Web

TypeScript: JavaScript With Syntax For Types.
TypeScript extends JavaScript by adding types to the language. TypeScript speeds up your development experience by catching errors and providing fixes ...
Read more >
The starting point for learning TypeScript
Find TypeScript starter projects: from Angular to React or Node.js and CLIs.
Read more >
Documentation - TypeScript for JavaScript Programmers
To cover these cases, TypeScript supports an extension of the JavaScript language, which offers places for you to tell TypeScript what the types...
Read more >
Documentation - TypeScript 3.9
Visual Studio Code supports selecting different versions of TypeScript. ... TypeScript 3.9 adds support to editing scenarios for this configuration.
Read more >
Documentation - TypeScript 4.5
TypeScript 4.5 introduces a way to override a specific built-in lib in a manner similar to how @types/ support works. When deciding which...
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