🔥 1. Components & Props –
React की तरह ही component system है.
components/Hello.js:
Use in page:
Next.js में ये सब super smooth चलता है — कोई config नहीं, कोई issue नहीं.
🧭 2. App Router ka असली मज़ा — Layouts
app/layout.js पूरे project का father component है.
अब हर page में ये header-footer खुद आएगा, जैसे Paratha के साथ free दही।
📦 3. Navigation — Link से चलो मस्त
Next.js में <Link> SEO-friendly navigation देता है.
No full reload.
No jhatka.
Just smooth transition.
🎯 4. Fetching Data — Server Components ka Jaadu
Next.js में server components default होते हैं, मतलब:
-
Data fetching page ke अंदर ही
-
कोई extra API call नहीं browser से
Example:
इसको कहते हैं:
“Backend भी अंदर, frontend भी अंदर — full paisa vasool!”
🍔 5. API Routes – अपने ही घर में छोटा backend
app/api/users/route.js
Use in frontend:
Browser को लगता है API कहीं cloud में है,
Developer को पता है — ये सब घर का खाना है 😄
🎨 6. Styling – CSS ka मेला
Option 1: Plain CSS
app/globals.css → Global CSS
Option 2: Module CSS
page.module.css
Use:
Option 3: Tailwind CSS
Sabse fast, sabse easy (let me know, I'll add full setup too).
🖼️ 7. Next.js Image Component –
Benefits:
-
Auto optimize
-
Lazy loading
-
CDN-ready
मतलब बिना gym किए images फिट और slim.
🚀 8. Dynamic Routes — Param wale pages
Make a folder:
Inside:
Open:
सब चलेगा — fully dynamic.
📂 9. Generate Static Pages Automatically
generateStaticParams() का use:
Next.js build time पर ये pages बना देगा → Speed = Ferrari.
💡 10. Bonus Tip — SEO without sweat
Add metadata in page:
Comments
Post a Comment