-
Hi, I don't know anything about react and javascript. I am just following https://nextjs.org/learn/basics/. Is it correct that layout.js needs to be changed from
to
? |
Beta Was this translation helpful? Give feedback.
Answered by
IamLizu
Jun 20, 2020
Replies: 1 comment 2 replies
-
Actually both of them are correct. Yes, let me explain.
Another difference is in the fist component, it was created first then exported. But on the second one, it was declared to export initially. You can do either one. But make sure to export the main function (i.e. Layout) as default. |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
2ynhub
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Actually both of them are correct. Yes, let me explain.
layout.module.css
which contains the stylesheet for the layout component. Imported asstyles
,layout.module.css
can be used throughout the module. So here,styles.container
means.container
class of modulelayout.module.css
.Another difference is in the fist component, it was created first then exported. But on the second one, it was declared to export initially. You can do either one. But make sure to export the main function (i.e. Layout) as default.