-
Notifications
You must be signed in to change notification settings - Fork 0
Nested Layouts #82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Nested Layouts #82
The head ref may contain hidden characters: "81-\u0440\u0430\u0437\u0431\u0438\u0442\u044C-layout"
Conversation
✅ Deploy Preview for cheerful-lily-b65942 ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
| return ( | ||
| <ViewLayout><Component {...pageProps} /></ViewLayout> | ||
| ) | ||
| const getLayout = Component.getLayout ?? ((page:any)=> page) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ааааа теперь понял)
Смотри у тебя сейчас куча дублей кода, давай так:
- Если Component приводит свой Layout то мы его подставляем
- Если же Component не выдвигает свой Layout, то мы подставляем по умолчанию:
<ViewLayout>
{page}
</ViewLayout>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ну дубли есть как бы), для каждой страницы лэйаут, а ты о чем?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Если ты НЕ переопределил функцию в компоненте, то подставлять ViewLayout иначе то что вернула функция. Тогда дубли уйдут
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
не понял а что это еще не закрытый тикет чтоль
No description provided.