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

feat(core): Allow multiple indexes in a single AttachStep #143

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ravanscafi
Copy link

@ravanscafi ravanscafi commented Mar 31, 2024

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!

childRef.current?.measureInWindow((x, y, width, height) => {
changeSpot({ height, width, x, y });
});
}
}, [changeSpot, current, index]);
}, [changeSpot, current, index.toString()]);
Copy link
Author

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]}>
Copy link
Author

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.

@FranzGB FranzGB requested a review from JoseLion April 12, 2024 23:26
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

Successfully merging this pull request may close these issues.

None yet

1 participant