Typescript cheat sheet for react functional components.
useRef
const divRef = useRef<HTMLDivElement>(null);
setState
const SkillSection = ({setScrollDuration} : {setScrollDuration: (value: number) => void}) => { }
interface SkillSectionProps { setScrollDuration: (value: number) => void; } const SkillSection: React.FC<SkillSectionProps> = ({ setScrollDuration }) => { // Your component logic here return ( // JSX ); };