React TypeScript CheatSheet

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
  );
};

About the Author: smartcoder

You might like

Leave a Reply

Your email address will not be published. Required fields are marked *