Posts

Showing posts from August, 2024

react context

 UserContext.js:-- import { createContext } from "react"; export const UserContext=createContext({     count: 0,     setCount: () => {},   }); Appcomponet:-   <UserContext.Provider value={{count,setCount}} >         <A/>               this is my app component{count}          <button onClick={handleClick}>click</button>       </UserContext.Provider> C.jsx:-- import React,{useContext} from 'react' import { UserContext } from './UserContext' export default function C() {   const {count,setCount}= useContext(UserContext);     // console.log(handleClick);          // console.log(count);      //    const info=useContext(UserContext); //    console.log(info);              const handleClick=()=>{       ...

redux[rtk query]

 https://www.youtube.com/watch?v=jyJIHebmC94 https://whataboutcoding.com/rtk-query-toolkit/ https://www.dhiwise.com/post/rtk-query-vs-react-query-breaking-down-the-technicalities todolist:-- https://medium.com/@sukronalifti/make-simple-create-read-update-and-delete-using-react-js-e85801a755b7 D:\learn\Todolistreact\todolist\src\data> npx json-server --watch db.json BUTTON COMPONENT DONT HAVE STYLE PROP.. BORDERRADIUS NO EFFECT IN IOS:IN TEXT COMPONENT SO WE HAVE TO WRAP IN VIEW NO INHERITANCE SUPPORTS SCROLLVIEW RENDER ALL THE CHILD ITEMS IN ONE GO SO LIMITED AMOUNT OF DATA ITS FINE BETTER SOLUTION:--FLATLIST COMPONENT ..SPECIFICALY RENDER THOSE WHO ARE VISIBLE AFTER SCROLLING ONLY IT WILL SCROLL NOTE:These versions should work together without issues. If you still encounter the RNSScreenStackHeaderConfig error, it could be related to something else like an incomplete installation, or the need to rebuild the project as mentioned earlier. video :95,96,97,98 >>>> In R...

interview questions js[ Anurag Singh ProCodrr]

 javascript:- nderstanding-the-difference-between-pure-and-impure-functions-in-javascript/ pure function:- that does not change outside value of the function 1: function geek(value) {      return value+100;  }     console.log(geek(34));  2: function capitalize(str) {    return str.toUpperCase();  }     console.log(capitalize('geeks')); ............................. lamda function[anonymous function] doesnt have name Lambda functions are pure functions in Javascript. let multiply = (a, b) => a * b; console.log(multiply(5, 9)); const Names = [   'Mansi',   'Gaurav',   'Akansha',   'Sanya' ]; console.log(Names.map(Names => Names.length));   array.slice[parts the array] gives array returns The slice() method returns selected elements in an array, as a new array. The slice() method selects from a given start, up to a (not inclusive) given end. The slice() method does not change the origi...

intervalquestionuseeffect

Image
 

reactnative_creation

 [EAS Build Service]:--for production Alternative:-- expo managed workflow:- expo go:-expo init projectname:-[built in feature] easy to setup and workflow quick &fictionless development no or very little congiguration you can build(cross-platform) standalone apps expo Bare workflow: [own native code android ] relatively easy to setup and work with convenient development some configuration required you can build(cross-platform) standalone apps [react native cli] setup:-- android studio jdk java setup xcode install react cli: more complex setup conveninent development can require more configuration effort standalone apps are build locally expo bare workflow:--- https://docs.expo.dev/versions/latest/sdk/location/ https://github.com/expo/expo/tree/sdk-51/packages/expo-location u can eject from managed expo  to bear workflow:-- just run  expo eject in terminal continue android package name:-com.companyname.domainname

async/await js

Image
 async is a keyword that is use to create async function async function returns a promise. async and await to handel promises........ we can write only inside await function await function suspends the function for a time being 

reactnativeexpobearer

Image
  search : https://www.youtube.com/watch?v=JR4fBbcB_AU&t=17s https://stackoverflow.com/questions/27620262/sdk-location-not-found-define-location-with-sdk-dir-in-the-local-properties-fil WARNING: The legacy expo-cli does not support Node +17. Migrate to the new local Expo CLI: https://blog.expo.dev/the-new-expo-cli-f4250d8e3421. in chat gpt u will find new command