Posts

Showing posts from July, 2024

GSAP notes

 <------------------------------------- GSAP IMPS -----------------------------------------> # Randoms 1. Remember to use the useEffect and useRef(to take the reference of that particular block link div,etc) hook while using GSAP library.    Example:-         const containerRef = useRef(null);         useEffect(() => {             const tl = gsap.timeline();               tl.to(containerRef.current, {               x: 800,               duration: 1,               delay: 2,               backgroundColor: "green",               rotate: 270,               borderRadius: "50%",               // both properties are requi...

ReactJs Notes

---------------------------------------------------- IMPORTANTS --------------------------------------------------- 1. 🧠  useMemo hook Firstly lets understand what is the meaning of Memo/Memoization -> memo means is that finding the solutions and storing them at same time. ie. let suppose teacher ask a student that what is 3*4 then firstly student will calculate it then store it in his memory and whenever teacher ask the same question again then student dont need to calculate it again, he can answer it right away because the answer is already stored in his memory. useMemo works pretty much on the same concept. useMemo hook is the way to prevent the unnessary expensive tasks/operation happening on the webapp. It stores the previous value of expensive function and prevent that function from running again and again on each re-rendering. Let me give u an example:- let suppose we have a page which only have 2 things one is the button which is increasing the count by 1, whenever it i...