Last active
July 2, 2022 05:13
-
-
Save oney/ba9ee3a197f107b97b4e2a08772d26c3 to your computer and use it in GitHub Desktop.
Revisions
-
oney revised this gist
Jul 2, 2022 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,10 +1,11 @@ import { useQuery } from "react-query"; import { BrowserRouter, Link, Route, Routes } from "react-router-dom"; export default function App() { return ( <BrowserRouter> <Routes> <Link to="/a">A</Link> <Route path="a" element={<A />} /> </Routes> </BrowserRouter> -
oney revised this gist
Jul 2, 2022 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,5 @@ import { useQuery } from "react-query"; import { BrowserRouter, Route, Routes } from "react-router-dom"; export default function App() { return ( -
oney revised this gist
Jul 2, 2022 . 1 changed file with 11 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,14 @@ import { BrowserRouter, Route, Routes, useQuery } from "react-query"; export default function App() { return ( <BrowserRouter> <Routes> <Route path="a" element={<A />} /> </Routes> </BrowserRouter> ); } function A() { const { isLoading, data } = useQuery("A", () => fetchA()); -
oney created this gist
Jul 2, 2022 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,19 @@ import { useQuery } from "react-query"; function A() { const { isLoading, data } = useQuery("A", () => fetchA()); if (isLoading) return <p>Loading</p>; return <div> {data} <B/> </div>; } function B() { const { isLoading, data } = useQuery("B", () => fetchB()); if (isLoading) return <p>Loading</p>; return <div> {data} <C/> </div>; } function C() { const { isLoading, data } = useQuery("C", () => fetchC()); if (isLoading) return <p>Loading</p>; return <div>{data}</div>; }