-
-
Notifications
You must be signed in to change notification settings - Fork 987
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
Update introduction and installation pages in the documentation #3274
Conversation
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.
wow, what an improvement! 🎉 🔥
docs/docs/guides/troubleshooting.md
Outdated
### Automatic workletization of gesture callbacks | ||
|
||
Reanimated's Babel plugin is setup in a way that automatically marks callbacks passed to gestures in the configuration chain as worklets. This means that as long as all your callbacks are defined in a single chain, you don't need to add a `'worklet';` directive at the beginning of the functions. Here is an example that will be automatically workletized: |
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 think it could be useful to give people links to concepts like:
workletization
https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/glossary#to-workletize
reanimated babel plugin
https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/glossary#reanimated-babel-plugin
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.
Done in 1aec22a
```jsx | ||
const callback = () => { | ||
console.log(_WORKLET); | ||
}; | ||
const gesture = Gesture.Tap(); | ||
gesture.onBegin(callback); | ||
``` |
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.
you should also write here that adding "worklet";
directive inside the function makes it work
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.
done in aa06fa3
Co-authored-by: Kacper Kapuściak <[email protected]>
Co-authored-by: Kacper Kapuściak <[email protected]>
Co-authored-by: Kacper Kapuściak <[email protected]>
Co-authored-by: Kacper Kapuściak <[email protected]>
Description
Update introduction page:
Updated installation page: