|
1 | | -<!DOCTYPE html><html lang="en"><head><meta charSet="utf-8"/><meta http-equiv="X-UA-Compatible" content="IE=edge"/><title>PanResponder · React Native</title><meta name="viewport" content="width=device-width"/><meta name="generator" content="Docusaurus"/><meta name="description" content="`PanResponder` reconciles several touches into a single gesture. It makes single-touch gestures resilient to extra touches, and can be used to recognize simple multi-touch gestures."/><meta name="docsearch:version" content="0.31"/><meta name="docsearch:language" content="en"/><meta property="og:title" content="PanResponder · React Native"/><meta property="og:type" content="website"/><meta property="og:url" content="https://facebook.github.io/react-native/"/><meta property="og:description" content="`PanResponder` reconciles several touches into a single gesture. It makes single-touch gestures resilient to extra touches, and can be used to recognize simple multi-touch gestures."/><meta name="twitter:card" content="summary"/><link rel="shortcut icon" href="/react-native/img/favicon.ico"/><link rel="stylesheet" href="https://cdn.jsdelivr.net/docsearch.js/1/docsearch.min.css"/><link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/solarized-dark.min.css"/><link rel="alternate" type="application/atom+xml" href="https://facebook.github.io/react-native/blog/atom.xml" title="React Native Blog ATOM Feed"/><link rel="alternate" type="application/rss+xml" href="https://facebook.github.io/react-native/blog/feed.xml" title="React Native Blog RSS Feed"/><script> |
| 1 | +<!DOCTYPE html><html lang="en"><head><meta charSet="utf-8"/><meta http-equiv="X-UA-Compatible" content="IE=edge"/><title>PanResponder · React Native</title><meta name="viewport" content="width=device-width"/><meta name="generator" content="Docusaurus"/><meta name="description" content="`PanResponder` reconciles several touches into a single gesture. It makes single-touch gestures resilient to extra touches, and can be used to recognize basic multi-touch gestures."/><meta name="docsearch:version" content="0.31"/><meta name="docsearch:language" content="en"/><meta property="og:title" content="PanResponder · React Native"/><meta property="og:type" content="website"/><meta property="og:url" content="https://facebook.github.io/react-native/"/><meta property="og:description" content="`PanResponder` reconciles several touches into a single gesture. It makes single-touch gestures resilient to extra touches, and can be used to recognize basic multi-touch gestures."/><meta name="twitter:card" content="summary"/><link rel="shortcut icon" href="/react-native/img/favicon.ico"/><link rel="stylesheet" href="https://cdn.jsdelivr.net/docsearch.js/1/docsearch.min.css"/><link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/solarized-dark.min.css"/><link rel="alternate" type="application/atom+xml" href="https://facebook.github.io/react-native/blog/atom.xml" title="React Native Blog ATOM Feed"/><link rel="alternate" type="application/rss+xml" href="https://facebook.github.io/react-native/blog/feed.xml" title="React Native Blog RSS Feed"/><script> |
2 | 2 | (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ |
3 | 3 | (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), |
4 | 4 | m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) |
|
68 | 68 | }; |
69 | 69 | } |
70 | 70 | }); |
71 | | - </script></nav></div><div class="container mainContainer"><div class="wrapper"><div class="post"><header class="postHeader"><a class="edit-page-link button" href="https://github.com/facebook/react-native-website/blob/master/docs/panresponder.md" target="_blank" rel="noreferrer noopener">Edit</a><h1 class="postHeaderTitle">PanResponder</h1></header><article><div><span><p><code>PanResponder</code> reconciles several touches into a single gesture. It makes single-touch gestures resilient to extra touches, and can be used to recognize simple multi-touch gestures.</p> |
| 71 | + </script></nav></div><div class="container mainContainer"><div class="wrapper"><div class="post"><header class="postHeader"><a class="edit-page-link button" href="https://github.com/facebook/react-native-website/blob/master/docs/panresponder.md" target="_blank" rel="noreferrer noopener">Edit</a><h1 class="postHeaderTitle">PanResponder</h1></header><article><div><span><p><code>PanResponder</code> reconciles several touches into a single gesture. It makes single-touch gestures resilient to extra touches, and can be used to recognize basic multi-touch gestures.</p> |
72 | 72 | <p>By default, <code>PanResponder</code> holds an `InteractionManager handle to block long-running JS events from interrupting active gestures.</p> |
73 | 73 | <p>It provides a predictable wrapper of the responder handlers provided by the <a href="/react-native/docs/0.31/gesture-responder-system">gesture responder system</a>. For each handler, it provides a new <code>gestureState</code> object alongside the native event object:</p> |
74 | 74 | <pre><code class="hljs">onPanResponderMove: <span class="hljs-function"><span class="hljs-params">(event, gestureState)</span> =></span> {} |
@@ -157,7 +157,7 @@ <h2><a class="anchor" aria-hidden="true" id="methods-1"></a><a href="#methods-1" |
157 | 157 | <h3><a class="anchor" aria-hidden="true" id="create"></a><a href="#create" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>create()</code></h3> |
158 | 158 | <pre><code class="hljs css language-jsx"><span class="token keyword">static</span> <span class="token function">create</span><span class="token punctuation">(</span>config<span class="token punctuation">)</span> |
159 | 159 | </code></pre> |
160 | | -<p>@param {object} config Enhanced versions of all of the responder callbacks that provide not only the typical <code>ResponderSyntheticEvent</code>, but also the <code>PanResponder</code> gesture state. Simply replace the word <code>Responder</code> with <code>PanResponder</code> in each of the typical <code>onResponder*</code> callbacks. For example, the <code>config</code> object would look like:</p> |
| 160 | +<p>@param {object} config Enhanced versions of all of the responder callbacks that provide not only the typical <code>ResponderSyntheticEvent</code>, but also the <code>PanResponder</code> gesture state, by replacing the word <code>Responder</code> with <code>PanResponder</code> in each of the typical <code>onResponder*</code> callbacks. For example, the <code>config</code> object would look like:</p> |
161 | 161 | <ul> |
162 | 162 | <li><code>onMoveShouldSetPanResponder: (e, gestureState) => {...}</code></li> |
163 | 163 | <li><code>onMoveShouldSetPanResponderCapture: (e, gestureState) => {...}</code></li> |
|
0 commit comments