import 'font-awesome/css/font-awesome.min.css' import React, { lazy } from 'react' import ReactDOM from 'react-dom/client' import { QueryClient, QueryClientProvider, QueryErrorResetBoundary, useQueryClient, } from '@tanstack/react-query' import { ReactQueryDevtools } from '@tanstack/react-query-devtools' import { ErrorBoundary } from 'react-error-boundary' import { fetchProjects } from './queries' import Button from './components/Button' const Projects = lazy(() => import('./components/Projects')) const Project = lazy(() => import('./components/Project')) const queryClient = new QueryClient({ defaultOptions: { queries: { retry: 0, }, }, }) function App() { return ( ) } function Example() { const queryClient = useQueryClient() const [showProjects, setShowProjects] = React.useState(false) const [activeProject, setActiveProject] = React.useState(null) return ( <>
{({ reset }) => ( (
There was an error!{' '}
{error.message}
)} onReset={reset} > {showProjects ? ( Loading projects...}> {activeProject ? ( ) : ( )} ) : null}
)}
) } const rootElement = document.getElementById('root') as HTMLElement ReactDOM.createRoot(rootElement).render()