Archive for November 2024

Next.Js using Context to pass data between components and avoid props drilling

‘use client’ import { createContext, useContext, useState } from ‘react’;   export const MyContext = createContext();   export function MyProvider({children}) { const [mymessage, setMymessage] = useState("");   return ( <MyContext.Provider value={{ mymessage, setMymessage }}> {children} </MyContext.Provider> ) }   export function useMy() { const context = useContext(MyContext) if (!context) { throw new Error(’useTheme must be […]

Dictionary of online marketing

PLA – Product Listing Ad – A commercing ad in Google, Bing to show individual product with images. On click it takes to PDP page with that ad PPC – Pay per click – advertisers pay a fee each time a user clicks on their ad