Kent C. Dodds
Kent C. Dodds
Hi Michael! Here's the app source code: https://github.com/kentcdodds/bookshelf And here's the deployed app: https://bookshelf.lol I hope that helps :) โ Kent C. Dodds --- original message --- On September 30,...
I didn't do any of that. That's @votajholik's brilliant work :)
Hi @wynsoft, I'm afraid this is difficult to answer without code, however to talk in general terms, consider how your users will trigger this code to run and try to...
Yeah, you definitely don't want to be using enzyme at all. Maybe the issue is in how you're mocking the API calls? Maybe this can help? https://kentcdodds.com/blog/stop-mocking-fetch
Maybe it's in this playlist? https://youtube.com/playlist?list=PLV5CVI1eNcJgNqzNwcs4UKrlJdhfDjshf
Thanks for the question @shall-git! Note @justsml, your solution there breaks the rules of hooks by making `useFetch` conditionally called due to the `if` statement. I'm actually ok with the...
Here's how I would write the reducer version of that: https://codesandbox.io/s/m58yn540j8 Note: there's more work to do there to cancel requests etc. But that's a good starting point.
I strongly recommend against trying to use suspense for data fetching before the react team says it's ready. Don't do it.
Good question @mpcen. I'll see about giving you an answer eventually :)
Could you clarify what you mean by "Functional tests?" Most people that I've talked to use this term interchangeably with End to End tests which typically gives you more code...