Are there any possibilities to re-use fetch outside of react component context?
Are there any possibilities to re-use fetch outside of react component context?
For example, if I want to use it together with redux.
That's an interesting question. I haven't thought about this. Not currently.
This was one of the first features I looked for. I was saddened it's not supported. Because there is usually a need to use functions natively not just in react hooks. Also it can ease the pain that you don't need to manually set the same configurations for different request functions. Like for example if I would use this library, I would also need to configure my native fetch or axios.
There was another library that doesn't have native support outside of react hooks that I came across. https://github.com/iamhosseindhv/notistack/issues/30. You can see how old the ticket is and how much there is need for such feature. I don't know what happened but, I think people just doesn't consider native support much since hooks came around. They are still vital