filter-ed promises not being executed in componentDidMount
See original GitHub issueBEGIN_GLOBAL_LOAD
/END_GLOBAL_LOAD
are dispatched on the client side even when filter
stops the asyncConnect
from blocking the render function. However, once the component is mounted, since the redux has saved the state loaded
as true
, it does not fetch the data. Due to this you have to manually redo the logic for re-fetching data in these instances. It would be nice to have some logic to ascertain that the promise is executed in componentDidMount
.
Issue Analytics
- State:
- Created 7 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
javascript - .filter(...).then is not a function in componentDidMount
Well yes, filter() always returns a new, filtered array. It doesn't return a Promise. Read more: developer.mozilla.org/en-US/docs/Web/JavaScript ...
Read more >Executing Promises in a React Component - Pluralsight
I am using the async/await syntax to handle the promise that fetch returns, as well as the promise returned by calling json() on...
Read more >Returning a Promise value from fetch - JavaScript
EDIT: The reason you are getting setState is not a function is because this is currently bound to your then callback. You need...
Read more >`useEffect()` and `async` - DEV Community
setState() [from inside componentDidMount()]; render(). Even though there is a second render, the React Docs state that the user will not see ...
Read more >Fetching Data in React using Hooks | by Chidume Nnamdi
useEffect is used to execute functions after a component gets rendered (to “perform side effects”). useEffect can be limited to cases where a ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
is there any solution / workaround for now?
I’ve just encountered this today, having just migrated from the unmaintained
redux-async-connect@1.0.0-rc4
. As such, I reverted back. It kinda sucks, I really wanted to leaveredux-async-connect
, since it complains that the react peerDependency version does not match, I’m using the latest 15.4.1.Are the solutions provided not good enough?
^ Is this a feasible solution?