KPKheersagar Parjainkheersagar.hashnode.dev·Dec 28, 2022 · 1 min readTailwind + React Native1. Create the project Create the project with the Expo CLI npx create-expo-app my-app cd my-app Install tailwind and its dependency yarn add nativewind yarn add --dev tailwindcss 2. Setup Tailwind CSS Run npx tailwindcss init to create a tailwin...00
KPKheersagar Parjainkheersagar.hashnode.dev·Nov 25, 2022 · 2 min readUpdate State After API Response React!!!Have you ever wondered why immediately after updating the state if it is logged, the value is undefined?? const fetchAPI = async () => { const res = await axios.get("https://catfact.ninja/fact"); setData((previousData) => ({ ...previousData...00
KPKheersagar Parjainkheersagar.hashnode.dev·Nov 24, 2022 · 2 min readRegular Function VS Fat Arrow FunctionRegular function function ATraditionalFunc () { console.log("inside traditonal function") } ATraditionalFunc() Output inside traditonal function Arrow Function or Fat Arrow function const AFatArrowFunc = () =>{ console.log("inside fatArrowFunc fu...00
KPKheersagar Parjainkheersagar.hashnode.dev·Nov 24, 2022 · 2 min readBlock scope Vs Global scope var, let, const !!!const a = 1; let b = 2; var c = 3; if(true){ const a = 10 let b = 20 var c = 30 console.log('Inside Block value of a = ' ,a ) console.log('Inside Block value of b = ' ,b ) console.log('Inside block value of c = ' ,c ) } console.log('...00
KPKheersagar Parjainkheersagar.hashnode.dev·Nov 24, 2022 · 1 min readAsynchronous to Synchronous JavaScriptPopular JavaScript Interview Question How to Convert Asynchronous code to Synchronous code ? Promises can be used to convert Asynchronous code to Synchronous code. Example Asynchronous setTimeout Function console.log("Before setTimeout") setTimeou...00