// You can also use TypeScript types to make the rest of ...props match // what the HTML props or component props would be for that tag. function Confetti({ tag: Tag, options, ...props }) { const nodeRef = useRef(null); /* logic */ return {/* stuff */}; }