From 43aeb40b2017730945861bfc3d98654ef0293134 Mon Sep 17 00:00:00 2001 From: Laktionov Anton Date: Thu, 18 Jun 2026 18:53:17 +0300 Subject: [PATCH] i dont know --- src/App.jsx | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/src/App.jsx b/src/App.jsx index 6bf3ac6..c927fba 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -1,10 +1,44 @@ -// удаляем все, оставляя лишь пустую функцию App ниже +import { useMutation, QueryClientProvider, QueryClient } from '@tanstack/react-query' +import PostAddForm from './components/PostAddForm' + +/* +const mutation = useMutation({ + mutationFn: newUser => { + fetch('https://jsonplaceholder.typicode.com/users', { + method: 'GET', + headers: {'Content-type':'application/json'}, + body: JSON.stringify(newUser), + }).then(res => res.json()) + } +}) +*/ + +const createQueryClient = () => { + new QueryClient({ + defaultOptions: { + queries: { + staleTime: 5 * 60*1000, + retry: 1, + gcTime: 10*60*1000, + refetchOnWindowFocus: false, + }, + mutations: { + retry:0, + onError: error => {console.error('Mutation error:',error.message)} + } + } + }) +} function App() { return ( <> {/* Добавьте тестовый контент для проверки */}

Hello, React!

+ + + + ) }