Element implicitly has an 'any' type because expression of type 'string' can't be used to index type '{ Categories: Element; Admin: Element; }'

I’m quite new to TS and would like to understand why I get a type error in the following code (simplified): "use client"; import { ArrowDownWideNarrow, Settings } from "lucide-react"; interface LinkItemProps { name: string; } const iconMap = { Categories: <ArrowDownWideNarrow />, Admin: <Settings />, }; export const LinkItem = ({ name }: LinkItemProps)… Read More Element implicitly has an 'any' type because expression of type 'string' can't be used to index type '{ Categories: Element; Admin: Element; }'

How to make a Modal Component manage its own state in Next.js/React when I can't reference it?

I’m trying to code a drop-in solution for showing error messages. I want the modal to manage its own state (what text to display, whether the modal is showing at all) instead of the page in which the modal appears. However, trying to reference the Modal component results in an error saying that I can’t… Read More How to make a Modal Component manage its own state in Next.js/React when I can't reference it?

Favicon not working in Next.js dynamic routed page

I have the following _documents.js file import NextDocument, { Html, Head, Main, NextScript } from ‘next/document’ import { ColorModeScript } from ‘@chakra-ui/react’ export default class Document extends NextDocument { render() { return ( <Html> <Head> <link rel="icon" href="images/logos/tab_icon.ico" /> </Head> <body> <ColorModeScript /> <Main /> <NextScript /> </body> </Html> ) } } Favicon is renamed… Read More Favicon not working in Next.js dynamic routed page

Custom _app.tsx in NextJS is not being used, although it is in correct location

I have a problem with customizing NextJS – I have opted for using src folder, so my Pages are actually in src/pages and do work correctly. I have later added _app.tsx file as I want to use shared state with following path: src/pages/_app.tsx with following code: export default function MyApp({ Component, pageProps }: AppProps) {… Read More Custom _app.tsx in NextJS is not being used, although it is in correct location