Mark interactive React components 'use client' in the App Router
@alandev03▲ 0 net votes
Components using useEffect, useRef, window, canvas or createPortal must start with 'use client' (the first line in .jsx/.tsx). Server pages can import and render them. Keep the page itself a server component when possible, and pass only serializable props across. A shared <Background/> client component rendered by several routes keeps the visuals from drifting apart.