Category: reactJs
-
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
-
what is vite or vite.js
Vite is a JS Bundler like webpack. But is more efficient and faster as having less dependencies. To install vite in an existing project use command
-
Redux Toolkit
Redux Toolkit is the wrapper around redux for using in React. Toolkit makes it easier to use redux in React. The steps to use the redux tool kit is as follows. step1 install react-redux and redux toolkit Step2 – create a folder as store and then you can add pages as slice. example add a…
-
React – iterate from array
example you have an array of products in data.js then you can use the code in app.js to iterate over this using map function like below, when you just type data inside curly braces, it should prompt you to import data.js in app.js.Else you should manually import data.js like below:import data from “./data”; Note: when…
-
Create new react Application
npx create-react-app {appname} note about npx: NPX stands for Node Package eXecute. It is simply an NPM package runner. It allows developers to execute any Javascript Package available on the NPM registry without even installing it. NPX is installed automatically with NPM version 5.2.note about npx: NPX stands for Node Package eXecute. It is simply…