use-http icon indicating copy to clipboard operation
use-http copied to clipboard

Are there any possibilities to re-use fetch outside of react component context?

Open lionskape opened this issue 4 years ago • 2 comments

Are there any possibilities to re-use fetch outside of react component context?

For example, if I want to use it together with redux.

lionskape avatar Apr 11 '21 21:04 lionskape

That's an interesting question. I haven't thought about this. Not currently.

iamthesiz avatar May 01 '21 15:05 iamthesiz

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

TheMeteoRain avatar Jan 14 '22 17:01 TheMeteoRain