import { useNavigate, Link } from 'react-router-dom' import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query'; import { fetchPageList, postNewPage } from '../apiTools.jsx'; import { useFixLinks } from '../clientStuff.jsx'; import PageList from './PageList.jsx'; import GraphRender from './GraphRender.jsx'; import './Landing.css' function Landing() { const queryClient = useQueryClient(); const navigate = useNavigate(); const makeNewPage = useMutation({ // for changing the value when we're done with it mutationFn: () => postNewPage() .catch((error) => { console.log("got an error", error.json()) }), onSettled: async (data, error, variables) => { // Invalidate and navigate to the new page await queryClient.invalidateQueries({ queryKey: ['pages'] }); navigate(`/${data}/edit`); }, }); return (