Tag: nextjs
-
Showing loader in nextJs
you need to wrap the children in root layout with a built in Suspense component. Example: Another way is to create a loading component in project root with the follow code also to use loading spinner you need to have tailwind and daisy-ui installed to install daisy ui use below command
-
Admin Layout
create an admin folder in app folder and then create a file named layout.tsx or layout.jsx. and create a component for layout like
-
react nextJs css module or scoped css
with convention you should name module.css like productcard.module.css and them import that css as and then you can use this css like Note: donot use css classes with name with hypen – as css classes are properties of javascript object style, which cannot have hypen. assuming that you have a class as card in ProductCard.module.css.
-
NextJs client component
for using client component you just need to add use client on top of the component and then you can use useState, useEffects and onClick listners More detailed example
-
NextJs App Routing
The App routing is a new feature in NextJs version 13 onwards.for creating routes using app routing These are the steps.