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

Step won't render when coming back from another route #55

Open
ahmadakhmiev opened this issue Dec 27, 2020 · 2 comments
Open

Step won't render when coming back from another route #55

ahmadakhmiev opened this issue Dec 27, 2020 · 2 comments

Comments

@ahmadakhmiev
Copy link

Hi,
Thanks for great work with the wizard. I just began using it on a new react project and it works good.
I'm having one issue though. I have two pages setup with routing. When I go to another page and come back to my page with the wizard steps, it won't render the step content.

Check out this code example that reproduces the issue:
https://codesandbox.io/s/react-wizard-d33qy

Note that I have put the Wizard inside index.js, this is so that I have access to the context from everywhere. When I put the Wizard inside my actual wizard component then it works fine.

Perhaps I'm doing it wrong (after all I'm new to react) ?

@ahmadakhmiev
Copy link
Author

I bit more investigation and it turns out that it is initialStepIndex that coulde be the issue here. Take a look at the updated example. Now even though the wizard is inside my wizard component when I come back to the page with the wizard it doesn't render anything. This is when the initialStepIndex is set. If it's not set then it renders the step at index 0.

@marcesdan
Copy link

@nohcho Are you using React in StrictMode ?

Because it can be related to #56

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

2 participants