gilbarbara / react-joyride

Create guided tours in your apps
https://react-joyride.com/
MIT License
6.75k stars 524 forks source link

Changing the 'steps' prop after first mount has no effect. #375

Closed fragosti closed 5 years ago

fragosti commented 6 years ago

Expected behavior

If I change the steps prop (via a setState or something), and I am controlling the component by using stepIndex, I would expect the component to update accordingly. For example, if stepIndex is 0, and I change the steps array such that the step at position 0 is different, the framework should react accordingly.

Actual behavior

No change.

Steps to reproduce the problem

Described above.

React version

15.6.1

React-Joyride version

2.0.0-11

Error stack

If you are having UI issues, make sure to send a public URL or codesandbox example.

gilbarbara commented 6 years ago

Please post an example in codesandbox

karanjariwala commented 6 years ago

@fragosti i had a similar issue just change the key prop of the Joyride component when you change steps this should remount the joy ride component and reinitialise all it's internal state. This is not a ideal solution. But it should work!

fragosti commented 6 years ago

I ended up throwing react-joyride out and making my own version :)