Download react-query/integrations/react-vite/src/App.jsx from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 453 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/react-query/integrations/react-vite/src/App.jsx
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset@1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/react-query/integrations/react-vite/src/App.jsx
-
curl -L -o App.jsx https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/react-query/integrations/react-vite/src/App.jsx
453 Bytes
| import React from 'react' | |
| import { useQuery } from '@tanstack/react-query' | |
| const App = () => { | |
| const query = useQuery({ | |
| queryKey: ['test'], | |
| queryFn: async () => { | |
| await new Promise((r) => setTimeout(r, 1000)) | |
| return 'Success' | |
| }, | |
| }) | |
| if (query.isPending) { | |
| return <div>Loading...</div> | |
| } | |
| if (query.isError) { | |
| return <div>An error has occurred!</div> | |
| } | |
| return <div>{query.data}</div> | |
| } | |
| export default App | |