satya164 / react-native-tab-view

A cross-platform Tab View component for React Native
MIT License
5.14k stars 1.07k forks source link

Initial tab in child tab view flickers while using react-native-tab-view #1406

Open MeghaSuthar20 opened 1 year ago

MeghaSuthar20 commented 1 year ago

Current behavior

https://user-images.githubusercontent.com/118166441/201921012-9f93bef1-1a78-4a2a-bc2d-85d1ea80a663.mp4

const renderCount = new Map(); const stickyTabRoutes = [ {key: 'first', title: strings.toDo}, {key: 'second', title: strings.comments}, {key: 'third', title: strings.done}, ]; export function HomeScreenTab() { return ( <StickyTab activeColor={'blue'} inactiveColor={'gray'} pressColor={'White'} stickyTabRoutes={stickyTabRoutes} stickyRenderTab1={

github-actions[bot] commented 1 year ago

The versions mentioned in the issue for the following packages differ from the latest versions on npm:

Can you verify that the issue still exists after upgrading to the latest versions of these packages?

github-actions[bot] commented 1 year ago

The versions mentioned in the issue for the following packages differ from the latest versions on npm:

Can you verify that the issue still exists after upgrading to the latest versions of these packages?

okwasniewski commented 1 year ago

Hello, thanks for opening this issue.

I looked through the repo code, and found that you are adding an inline function to SceneMap, which is not recommended in the README:

IMPORTANT: Do not pass inline functions to SceneMap, for example, don't do the following:

SceneMap({
  first: () => <FirstRoute foo={this.props.foo} />,
  second: SecondRoute,
});

Do you see the same behaviour in examples inside the example directory? Please correct the repro code and I will check it.