diff options
author | Galen Guyer <galen@galenguyer.com> | 2020-11-13 20:38:09 -0500 |
---|---|---|
committer | Galen Guyer <galen@galenguyer.com> | 2020-11-13 20:38:09 -0500 |
commit | 5d5c39b6d318a91dd5062d829cecf3dcdd25ccab (patch) | |
tree | 7c21646a7509f773e020d85c65a2e7660cd200c3 /src/index.js | |
parent | 2a844fc6834c3fd512de78da4a8d1c20b41b384a (diff) |
Add swr and configs
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") ); |