Skip to content

Commit

Permalink
Add ReactQuery (#374)
Browse files Browse the repository at this point in the history
Adds ReactQuery to handle async state, this PR only adds the dependency
and wires up the provider it is currently unused
  • Loading branch information
schreiaj authored Nov 7, 2024
1 parent 2d4c6c7 commit 74b994b
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 31 deletions.
56 changes: 26 additions & 30 deletions frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"e2e:ui": "npx playwright test --ui"
},
"dependencies": {
"@tanstack/react-query": "^5.59.20",
"@trussworks/react-uswds": "^9.0.0",
"@types/hex-rgb": "^3.0.0",
"@uswds/uswds": "^3.8.1",
Expand Down
6 changes: 5 additions & 1 deletion frontend/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {useLocation} from "react-router-dom";
import {AppHeader} from "./components/AppHeader/AppHeader.tsx";

import {TemplatesIndex} from "./components/TemplatesIndex/TemplatesIndex.tsx";
import {QueryClient, QueryClientProvider} from "@tanstack/react-query";
function App() {
const {pathname} = useLocation()
const navLinks = [
Expand All @@ -13,8 +14,11 @@ function App() {
{text: "Dashboard", url: "/dashboard"}
]

const queryClient = new QueryClient();

return (
<>
<QueryClientProvider client={queryClient}>
<div className='display-flex flex-column width-full height-full'>
<AppHeader jurisdiction={`Demo STLT`}/>
<div className="display-flex flex-row height-full">
Expand All @@ -41,7 +45,7 @@ function App() {
</div>

</div>

</QueryClientProvider>
</>
)
}
Expand Down

0 comments on commit 74b994b

Please sign in to comment.