title: How to fix the error argument of type string or undefined is not assignable to parameter of type string using typescript and react?
body: <p>i am getting error argument of type string or undefined is not assignable to parameter of type string using typescript and react</p>
  <p>below is my code,</p>
  <pre class="lang-js prettyprint-override"><code>    function List({items}: Props) { 
          const [activeindex, setActiveindex] = React.useState&lt;string&gt;();
          return (
              items.map((item: any) =&gt; {
                  &lt;AddButton setActiveIndex={setActiveIndex} itemId={item.id}/&gt;
              }
          );
      }
  
      
      interface AddButtonProps {
          setActiveIndex: any;
          itemId?: string;
      }
      function AddButton ({setActiveIndex, itemId}: AddButtonProps){
          const {toggleDrawing} = useDrawing();
          const handleClick = (itemId) =&gt; {
              setActiveIndex(itemId);
              toggleDrawing(itemId); //error here
          }
          return (
              &lt;Button onClick={handleClick}/&gt;
          );
      );
  
  
      function useDrawing () {
          const [editableItemId, setEditableItemId] = React.useState&lt;string&gt;();
          const toggleDrawing = React.useCallback(async (itemId: string) =&gt; {
              if (isDrawing &amp;&amp; editableItemId === itemId) {
                  cancelDrawing();
              } else if (isDrawing) {
                  cancelDrawing();
                  setEditableItemId(itemId);
              } else {
                  setEditableWorkAreaId(itemId);
              }
          },
              [isDrawingPolygon, editableItemId, cancelDrawing]
      );
  }
  </code></pre>
  <p>I am not sure why i am getting this error. could someone help me fix this. thanks.</p>