Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Tab icons mounted twice #2576

Closed
kesha-antonov opened this issue Nov 1, 2017 · 9 comments
Closed

[Bug] Tab icons mounted twice #2576

kesha-antonov opened this issue Nov 1, 2017 · 9 comments

Comments

@kesha-antonov
Copy link
Contributor

Version

Tell us which versions you are using:

  • react-native-router-flux v4.0.0-beta22 (from master)
  • react-native v0.49.5

Expected behaviour

5 tabs mounted only once.

Actual behaviour

5 tabs mounted twice.

screen shot 2017-11-01 at 22 24 38 1

<Tabs icon={TabIcon}>
  <Scene />
  <Scene />
  <Scene />
  <Scene />
  <Scene />
</Tabs>
@SoldierCorp
Copy link

SoldierCorp commented Nov 4, 2017

Same error but we don't know whether the error belons to react nativation or this repository.

@jaschaio
Copy link

Having the same issue, both with Tabs, Drawers or Modals. #2449, #2382 and #2388 are probably related. The lazy property as suggested in #2440 helped with the other Tabs, but the inital one is still mounted twice.

@aksonov
Copy link
Owner

aksonov commented Jan 4, 2018

I can't reproduce it with Example project. I added logging to TabView.js and see exactly 5 statements.

@aksonov
Copy link
Owner

aksonov commented Jan 5, 2018

Looks like the issue not in RNRF (because it doesn't mount/render scenes at all):react-navigation/react-navigation#476

@aksonov aksonov closed this as completed Jan 5, 2018
@mightym
Copy link

mightym commented Jan 15, 2018

Same issue here. rebuild my whole setup with react-navigation. No issue.

Here is the issue, assume the following structure:

<Tabs key='tabbar'>
    <Stack key='tab_1'}>
        <Scene key='home'>
        <Scene key='list'>
        <Scene key='detail'>
    </Stack>
    <Stack key='tab_2'}>
        <Scene key='profile'>
    </Stack>
</Tabs>

and now navigate to tabbar or to home. and you will see componentWillMount will be called multiple times

@aksonov
Copy link
Owner

aksonov commented Aug 8, 2018

Please try to reproduce it with Example project and latest version 4.0.0-beta.40. Feel free to open if the issue still exists

@malithjkmt
Copy link

<Router sceneStyle={styles.main}>
    <Tabs
        key="tabs"
        showLabel={false}
        icon={TabIcon}>
        <Scene
            key="tab1"
            component={PostJobView}
            title='A' />
        <Scene
            key="tab2"
            component={ProfileView}
            title='B' />
    </Tabs>
</Router>

TabIcon function is called twice for each Scene.
I checked that router renders only once.

image

react: 16.4.1
react-native: 0.56.0

Tested for all react-native-router-flux: 4.0.0-beta.31, 4.0.0-beta.40, and the latest version - 4.0.6

@tuaaasa
Copy link

tuaaasa commented Mar 25, 2019

Same issue here.

@sandeep-sethia
Copy link

I am facing a similar issue. is there a simple workaround?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants