-
Notifications
You must be signed in to change notification settings - Fork 28
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
feat(core): Allow multiple indexes in a single AttachStep #143
Conversation
childRef.current?.measureInWindow((x, y, width, height) => { | ||
changeSpot({ height, width, x, y }); | ||
}); | ||
} | ||
}, [changeSpot, current, index]); | ||
}, [changeSpot, current, index.toString()]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is needed to compare arrays, otherwise, they will always differ and useEffect
will be called infinite times.
@@ -24,7 +24,7 @@ function TestScreen(): React.ReactElement { | |||
<Text>{"Test Tour 1"}</Text> | |||
</AttachStep> | |||
|
|||
<AttachStep index={1}> | |||
<AttachStep index={[1]}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this ensures using an array of indexes will break no other behaviors.
@ravanscafi, thank you for your contribution! I'm sorry it took me so long to review this PR. I like the idea of attaching the same view to multiple steps. It provides more flexibility and reduces the need for code repetition. We're currently working on a major release, so I'll pick it from here to resolve conflicts and ensure everything works with the planned changes. Thanks again for your contribution! 🎉 |
7f3d1c2
to
b264424
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I made a few changes, but in general this looks good to me! Thanks for your contribution 🎉
@all-contributors please add @ravanscafi for code. |
I've put up a pull request to add @ravanscafi! 🎉 |
@all-contributors please add @ravanscafi for code. |
@ravanscafi already contributed before to code |
Thank you @JoseLion! 🎉 |
Hello!
Sorry for proposing this feature directly as a Pull Request, but I needed it for my own Tour and thought it would be nice to contribute to the project :)
Let me know what you think and how we can make it better!