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

Duplication scene. #2905

Closed
JJMoon opened this issue Feb 27, 2018 · 2 comments
Closed

Duplication scene. #2905

JJMoon opened this issue Feb 27, 2018 · 2 comments

Comments

@JJMoon
Copy link

JJMoon commented Feb 27, 2018

Version

Tell us which versions you are using:

  • react-native-router-flux 4.0.0-beta.28
  • react v 16.2.0
  • react-native v 0.53.3

Expected behaviour

Create one scene.

Actual behaviour

Create two scene.

Steps to reproduce

The source code is as follows.

<Provider store={createStore(reducers)}>
        <Router>
          <Scene key="root" hideNavBar>      
            <Scene key="registInit" component={RegistInit} initial />

           <Scene key="sceneHistory" component={RemitHistory} />

            <Drawer contentComponent={SideMenuMain} panHandlers={null}>
              <Scene key="mainonly" hideNavBar>
                <Scene key="sceneRemit" component={Remit} initial />
              </Scene>
            </Drawer>
      
          </Scene>
        </Router>

Current Situation

When I go from the first scene 'registInit' to 'sceneRemit', two instances of sceneRemit are made.
If I put Alert popup in componentDidMount, two popups appears repeatedly. So, the instances are real.
Of course, I can 'pop' the 2nd scene, but it makes uncanny animation.

Workaround and side effect

If I remove scene 'mainonly', only one instance is generated, but popTo('sceneRemit') doesn't work.
From registInit > sceneRemit > sceneHistory >> popTo('sceneRemit') this doesn't work.

Am I using Drawer or Scenes incorrectly?
How can I use these scenes with or without Drawer ?

@rexlow
Copy link

rexlow commented Jun 13, 2018

+1

@aksonov
Copy link
Owner

aksonov commented Aug 8, 2018

It is not a bug, but feature - first scene is already part of the stack. So you name of stack/drawer, not name of first scene

@aksonov aksonov closed this as completed Aug 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants