mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
3212f7dfe8
Summary: *Pressable* is a component which is intended to replace the Touchable* components such as *TouchableWithoutFeedback* and *TouchableOpacity*. The motivation is to make it easier to create custom visual touch feedback so that React Native apps are not easily identified by the “signature opacity fade” touch feedback. We see this component as eventually deprecating all of the existing Touchable components. Changelog: [Added][General] New <Pressable> Component to make it easier to create touchable elements Reviewed By: yungsters Differential Revision: D19674480 fbshipit-source-id: 765d657f023caea459f02da25376e4d5a2efff8b
35 lines
759 B
JavaScript
35 lines
759 B
JavaScript
/**
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*
|
|
* @format
|
|
* @emails oncall+react_native
|
|
* @flow strict-local
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
import * as React from 'react';
|
|
|
|
import Pressable from '../Pressable';
|
|
import View from '../../View/View';
|
|
import {expectRendersMatchingSnapshot} from '../../../Utilities/ReactNativeTestTools';
|
|
|
|
describe('<Pressable />', () => {
|
|
it('should render as expected', () => {
|
|
expectRendersMatchingSnapshot(
|
|
'Pressable',
|
|
() => (
|
|
<Pressable>
|
|
<View />
|
|
</Pressable>
|
|
),
|
|
() => {
|
|
jest.dontMock('../Pressable');
|
|
},
|
|
);
|
|
});
|
|
});
|