Files
react-native/website/versioned_docs/0.18/touchablewithoutfeedback.md
T
2017-10-27 11:51:58 -07:00

13 lines
4.0 KiB
Markdown

---
id: version-0.18-touchablewithoutfeedback
title: touchablewithoutfeedback
original_id: touchablewithoutfeedback
---
<a id="content"></a><h1>TouchableWithoutFeedback</h1><div><div><p>Do not use unless you have a very good reason. All the elements that
respond to press should have a visual feedback when touched. This is
one of the primary reason a "web" app doesn't feel "native".</p></div><h3><a class="anchor" name="props"></a><a class="edit-github" href="https://github.com/facebook/react-native/blob/master/Libraries/Components/Touchable/TouchableWithoutFeedback.js">Edit on GitHub</a>Props <a class="hash-link" href="#props">#</a></h3><div class="props"><div class="prop"><h4 class="propTitle"><a class="anchor" name="accessibilitycomponenttype"></a>accessibilityComponentType <span class="propType">View.AccessibilityComponentType</span> <a class="hash-link" href="#accessibilitycomponenttype">#</a></h4></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="accessibilitytraits"></a>accessibilityTraits <span class="propType">View.AccessibilityTraits, [View.AccessibilityTraits]</span> <a class="hash-link" href="#accessibilitytraits">#</a></h4></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="accessible"></a>accessible <span class="propType">bool</span> <a class="hash-link" href="#accessible">#</a></h4></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="delaylongpress"></a>delayLongPress <span class="propType">number</span> <a class="hash-link" href="#delaylongpress">#</a></h4><div><p>Delay in ms, from onPressIn, before onLongPress is called.</p></div></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="delaypressin"></a>delayPressIn <span class="propType">number</span> <a class="hash-link" href="#delaypressin">#</a></h4><div><p>Delay in ms, from the start of the touch, before onPressIn is called.</p></div></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="delaypressout"></a>delayPressOut <span class="propType">number</span> <a class="hash-link" href="#delaypressout">#</a></h4><div><p>Delay in ms, from the release of the touch, before onPressOut is called.</p></div></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="onlayout"></a>onLayout <span class="propType">function</span> <a class="hash-link" href="#onlayout">#</a></h4><div><p>Invoked on mount and layout changes with</p><p> <code>{nativeEvent: {layout: {x, y, width, height}}}</code></p></div></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="onlongpress"></a>onLongPress <span class="propType">function</span> <a class="hash-link" href="#onlongpress">#</a></h4></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="onpress"></a>onPress <span class="propType">function</span> <a class="hash-link" href="#onpress">#</a></h4><div><p>Called when the touch is released, but not if cancelled (e.g. by a scroll
that steals the responder lock).</p></div></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="onpressin"></a>onPressIn <span class="propType">function</span> <a class="hash-link" href="#onpressin">#</a></h4></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="onpressout"></a>onPressOut <span class="propType">function</span> <a class="hash-link" href="#onpressout">#</a></h4></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="pressretentionoffset"></a>pressRetentionOffset <span class="propType">{top: number, left: number, bottom: number, right: number}</span> <a class="hash-link" href="#pressretentionoffset">#</a></h4><div><p>When the scroll view is disabled, this defines how far your touch may
move off of the button, before deactivating the button. Once deactivated,
try moving it back and you'll see that the button is once again
reactivated! Move it back and forth several times while the scroll view
is disabled. Ensure you pass in a constant to reduce memory allocations.</p></div></div></div></div><div class="docs-prevnext"><a class="docs-next" href="view.html#content">Next →</a></div>