stackbuilders / react-native-spotlight-tour

A highly customizable tour feature with an awesome spotlight effect
https://stackbuilders.github.io/react-native-spotlight-tour/
MIT License
237 stars 27 forks source link

Suggestion: Add name/key property to AttachStep instead of index #134

Open AnsonT opened 1 year ago

AnsonT commented 1 year ago

I'd like to suggest that instead using index to map the attach step to the steps array, it'll be more flexible to use a key/name for the attachStep, and the steps array just referencnes the key. This way, it's easy to rearrange the order of the steps just by rearranging the steps array, instead of renumbering the AttachSteps all around the application.

JoseLion commented 10 months ago

Thank you very much for the suggestion. I like the idea; I have been thinking about this for some time now. The main challenge is keeping type safety around the keys and the steps, but it's not a blocker. As you mentioned, using keys instead of indexes has more than one benefit. We'll put this under our scope next.