Next.js Discord

Discord Forum

whats diff between { navbar } and navbar

Answered
Auth posted this in #help-forum
Open in Discord
Avatar
AuthOP
like when we import component which way is correct
import { Navbar } from "../components/Navbar"
or
import Navbar from "../components/Navbar"
Answered by Princess Tsundere
1st one is named export
View full answer

7 Replies

Avatar
Princess Tsundere
1st one is named export
Answer
Avatar
Princess Tsundere
second one is default export
export const something = "something"; -> this is named export
export default something -> this is default export
^ hope this helps
Avatar
AuthOP
oh alright