From 86eb3ef516acad763c908540a21e5b423c2d1672 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrycja=20Kali=C5=84ska?= Date: Tue, 16 Jul 2024 13:15:44 +0200 Subject: [PATCH 01/11] docs: rewrite dispatchCommand --- .../docs/advanced/dispatchCommand.mdx | 35 ++++++++++++++++--- 1 file changed, 30 insertions(+), 5 deletions(-) diff --git a/packages/docs-reanimated/docs/advanced/dispatchCommand.mdx b/packages/docs-reanimated/docs/advanced/dispatchCommand.mdx index 4bd2c16f0e4..7aea317b4e0 100644 --- a/packages/docs-reanimated/docs/advanced/dispatchCommand.mdx +++ b/packages/docs-reanimated/docs/advanced/dispatchCommand.mdx @@ -4,11 +4,34 @@ sidebar_position: 7 # dispatchCommand -import DocsCompatibilityInfo from '../_shared/_docs_compatibility_info.mdx'; +import DispatchCommand from '@site/src/examples/DispatchCommand'; +import DispatchCommandSrc from '!!raw-loader!@site/src/examples/DispatchCommand'; - +`dispatchCommand` allows you to dispatch command on a native component. It happens synchronously from the UI thread. -Allows to dispatch command on a native component synchronously from the UI thread. +## Reference + +```javascript +import { dispatchCommand } from 'react-native-reanimated'; + +function App() { + const animatedRef = useAnimatedRef() + + const gesture = Gesture.Tap().onStart(() => { + dispatchCommand(animatedRef, 'focus) + }) + + return ( + <> + + +