React 18 error in the first part of the course

Hello All,
In the below code when i include the error condition my gameGird is gone


Can some one let me know what is the error here. And please help me with the undefined games part

import { SimpleGrid, Text } from “@chakra-ui/react”;
import useGames from “…/hooks/useGames”;
import GameCard from “./GameCard”;
import GameCardSkeleton from “./GameCardSkeleton”;
import GameCardContainer from “./GameCardContainer”;
import { GameQuery } from “…/App”;

interface Props {
gameQuery: GameQuery;
}
const GameGrid = ({ gameQuery }: Props) => {
const { data, error, isLoading } = useGames(gameQuery);
const skeletons = [1, 2, 3, 4, 5, 6];

if (error) return {error};

return (
<SimpleGrid
columns={{ sm: 1, md: 2, lg: 3, xl: 4 }}
padding=“10px”
spacing={6}
>
{isLoading &&
skeletons.map((skeleton) => (



))}
{data?.map((game) => (



))}

);
};

export default GameGrid;