title: React.memo and typescript
body: <p>I am working on a react native app. I am currently using Item component to display data in flatlist. But editor gives me an error for the second parameter of React.memo like below.</p>
  <p>Type 'boolean | undefined' is not assignable to type 'boolean'.</p>
  <p>Type 'undefined' is not assignable to type 'boolean'.</p>
  <pre><code>const Item = React.memo(
      ({ icon, title }: any) =&gt; {
          return (
              &lt;Box
                  flexDirection=&quot;row&quot;
                  paddingHorizontal=&quot;l&quot;
                  justifyContent=&quot;space-between&quot;
                  alignItems=&quot;center&quot;
                  style={{ marginTop: 35 }}
              &gt;
                  &lt;Box flexDirection=&quot;row&quot; alignItems=&quot;center&quot; flex={1}&gt;
                      {icon}
  
                      &lt;Box marginLeft=&quot;l&quot;&gt;
                          &lt;Text  variant=&quot;stackHeader&quot;&gt;{title}&lt;/Text&gt;
                          &lt;Text
                              fontSize={15}
                              fontFamily=&quot;CrimsonRegular&quot;
                              style={{ color: '#575757' }}
                          &gt;
                              Last update: 03/06/2020
                          &lt;/Text&gt;
                      &lt;/Box&gt;
                  &lt;/Box&gt;
                  &lt;TouchableOpacity onPress={() =&gt; Clipboard.setString(title as string)}&gt;
                  &lt;FontAwesome5 name=&quot;copy&quot; size={28} color=&quot;white&quot; /&gt;
                  &lt;/TouchableOpacity&gt;
              &lt;/Box&gt;
          );
      },
      (prev, next) =&gt; { // error here
          if (prev.title === next.title) {
              return true;
          }
      }
  );
  </code></pre>