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.

Out of date docs or incorrect types?

See original GitHub issue

🐛 Bug Report

When using typescript there are two issues. Once when using the syntax from the prefetching docs: https://www.smooth-code.com/open-source/loadable-components/docs/prefetching/ and the other when trying to preload.

To Reproduce

// Argument of type '() => string' is not assignable to parameter of type '(props: {}) => Promise<DefaultComponent<{}>>'.
// Type 'string' is not assignable to type 'Promise<DefaultComponent<{}>>'.
export const User = () => loadable(() => './User')

and

export const User = () => loadable(() => import('./User'))

// Property 'preload' does not exist on type '() => ComponentType<{ fallback?: Element | undefined; }>'.
User.preload()

Expected behavior

Typescript should not error and docs should be updated

Details


## System:
 - OS: Linux 4.4 Ubuntu 16.04.2 LTS (Xenial Xerus)
 - CPU: (16) x64 AMD Ryzen 7 1700X Eight-Core Processor
 - Memory: 8.81 GB / 15.95 GB
 - Shell: 4.3.46 - /bin/bash
## Binaries:
 - Node: 10.15.0 - ~/.nvm/versions/node/v10.15.0/bin/node
 - Yarn: 1.9.4 - ~/.yarn/bin/yarn
 - npm: 6.4.1 - ~/.nvm/versions/node/v10.15.0/bin/npm

Issue Analytics

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

github_iconTop GitHub Comments

2reactions
theKasheycommented, Feb 13, 2019

:working:

1reaction
pviniscommented, Feb 13, 2019

@theKashey I guess?

Read more comments on GitHub >

github_iconTop Results From Across the Web

ISDATE function - Google Docs Editors Help
The ISDATE function returns whether a value is a date. ... Part, Description. value, The value to be verified as a date. ......
Read more >
Working with Dates and Times | Google Ads Scripts
Google Ads scripts often need to work with dates and times. Common use cases include retrieving reports for a specific date range, scheduling...
Read more >
Date() constructor - JavaScript - MDN Web Docs - Mozilla
You are therefore also advised to make sure the input format is consistent between the two types. Date object. dateObject. An existing Date...
Read more >
Data types | BigQuery - Google Cloud
This page provides an overview of all Google Standard SQL for BigQuery data types, including information about their value domains. For information on...
Read more >
8.0 Correcting Errors or Missing Information on Form I-9 - USCIS
Draw a line through the incorrect information;; Enter the correct or missing information; and; Initial and date the correction.
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