Next.js Discord

Discord Forum

MUI HideAppBar component with nextjs app router

Unanswered
Saltwater Crocodile posted this in #help-forum
Open in Discord
Avatar
Saltwater CrocodileOP
error:
.next/types/app/page.ts:26:13
Type error: Type 'OmitWithTag<Props, keyof PageProps, "default">' does not satisfy the constraint '{ [x: string]: never; }'.    
  Property 'children' is incompatible with index signature.
    Type 'any' is not assignable to type 'never'.

  24 |
  25 | // Check the prop type of the entry function
> 26 | checkFields<Diff<PageProps, FirstArg<TEntry['default']>, 'default'>>()
     |             ^
  27 |
  28 | // Check the arguments and return type of the generateMetadata function
  29 | if ('generateMetadata' in entry) {


app/page.jsx code
I guess here the props is empty, any workaround for this?
import React from "react";
import styles from "./page.module.css";
import HideAppBar from "./components/navbar";
import Box from "@mui/material/Box";
import Typography from "@mui/material/Typography";
import Button from "@mui/material/Button";
import Container from "@mui/material/Container";
import Matches from "./home/components/matches";

interface Props {
  children: React.ReactElement;
}

export default function page(props: Props) {
  return (
      <>
        <HideAppBar {...props} />
        // Other code
       </>
)};


mui hideappbar:
https://mui.com/material-ui/react-app-bar/#hide-app-bar

0 Replies