diff options
Diffstat (limited to 'src/index.js')
-rw-r--r-- | src/index.js | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/index.js b/src/index.js index c965911..ea743ca 100644 --- a/src/index.js +++ b/src/index.js @@ -1,12 +1,16 @@ import React from "react"; import ReactDOM from "react-dom"; +import { SWRConfig } from "swr"; import "./index.css"; import App from "./App"; -import reportWebVitals from "./reportWebVitals"; + +const fetcher = (...args) => fetch(...args).then((res) => res.json()); ReactDOM.render( <React.StrictMode> - <App /> + <SWRConfig value={{ fetcher }}> + <App /> + </SWRConfig> </React.StrictMode>, document.getElementById("root") ); |