在使用 Next.js 开发我的个人作品集时,我遇到了一个错误,即“children”道具不起作用。我正在使用 tsx.
布局.tsx
import styles from "./layout.module.css";
export default function Layout({ children, ...props }) {
return (
<>
<main className={styles.main} {...props}>{children}</main>
</>
);
}
Run Code Online (Sandbox Code Playgroud)
我尝试使用其他道具,定义道具,就像我在网上教程中所做的那样,但它们都不起作用。;(