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.

useAsyncState type error

See original GitHub issue

After update to 7.5.4 get error

TS2322: Type 'false' is not assignable to type 'true | undefined'.
  const { state, isReady, execute } = useAsyncState(promise, initialState, {
    shallow: false,
  })

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:11 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
darkxantercommented, Feb 15, 2022

Maybe fix it somehow so that don’t require explicit false in type parameter?

0reactions
webfansplzcommented, Feb 15, 2022

Maybe fix it somehow so that don’t require explicit false in type parameter?

I dont’ think so, it’s designed to provide more accurate type for state .

Read more comments on GitHub >

github_iconTop Results From Across the Web

useAsyncState - VueUse
(e: Error) => void /** * Sets the state to initialState before executing the promise. * * This can be useful when calling...
Read more >
useAsyncState's execute will not throw exceptions · Issue #1629
Describe the bug I think sometimes I just use the execute of useAsyncState to call manually, at this time I prefer to handle...
Read more >
reactjs - useState Inside Async Function Throws TypeError
The Code works but when I add the setLoading hook inside handleSubmit then I get the following error. TypeError: Cannot read properties of...
Read more >
Handling Asynchrony in Vue 3 / Composition API
If the server sends an error response, the view would be stuck in spinner land forever. ... **vue-composition-toolkit **— useAsyncState
Read more >
react-async-state-hook - npm
React Async State provides the hook useAsyncState to replace the React ... If callback was unsuccesful then the data on the error is...
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