Answer the question
In order to leave comments, you need to log in
How to fix module error in NextJs-App?
I want to import the Htag module from the Components folder to index.tsx, but on the page it says that the module was not found, although everything is correct in the IDE
Htag.tsx
import {HtagProps} from "./Htag.props";
export const Htag = ({tag, children}:HtagProps):JSX.Element => {
return(<h1>{children}</h1>);
}
import {ReactNode} from "react";
export interface HtagProps {
tag: 'h1' | 'h2' | 'h3';
children:ReactNode;
}
export * from './Htag/Htag';
import React from "react";
import {Htag} from "../Components";
export default function Home(): JSX.Element {
return (
<div>
<Htag tag={'h1'}>Text</Htag>
</div>
);
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question