Skip to content
Discussion options

You must be logged in to vote

Actually both of them are correct. Yes, let me explain.

  1. A simple component, renders children.
  2. Renders children but also imports a css module named layout.module.css which contains the stylesheet for the layout component. Imported as styles, layout.module.css can be used throughout the module. So here, styles.container means .container class of module layout.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.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@2ynhub
Comment options

@IamLizu
Comment options

Answer selected by 2ynhub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants