title: react native : How to fix the error - Passing an inline function will cause the component state to be lost on re-render?
body: <p><strong>I got this warning :</strong>
  &quot;Passing an inline function will cause the component state to be lost on re-render and cause perf issues since it's re-created every render. You can pass the function as children to 'Screen' instead to achieve the desired behaviour&quot;.
  I try to pass the <code>item</code> parameter to the &quot;Neptun&quot; component function type and then I get the above error.
  How can I fix this issue ?</p>
  <pre><code>&lt;Tab.Screen
            name=&quot;FOOD&quot;
            component={() =&gt; &lt;Neptun item={item} /&gt;}
            listeners={({ route }) =&gt; ({
              focus: () =&gt; {
                dispatch(
                  setCurrentTabInfoAction({
                    currentTabName: route.name,
                    type: 'approved',
                  })
                );
              },
            })}
          /&gt;
          &lt;Tab.Screen
  </code></pre>