mlegenhausen / fetch-intercept

Interceptor library for the native fetch command inspired by angular http intercepts.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

fetch-intercept in React

opened this issue · comments

Hi, the question is not complicated. How to use correctly your library with React?

I make a function call in this way:

import fetchIntercept from './fetchIntercept';

const App = () => {
  
  fetchIntercept(); <---

  return (
    <>
      ...content...
    </>
  );
};

Use the function once in the main file of your application like

import fetchIntercept from './fetchIntercept';

fetchIntercept(); <---

const App = () => {
  return (
    <>
      ...content...
    </>
  );
};