mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Minor: Rename AccessibilityInfo.sendAccessibilityEvent_unstable to sendAccessibilityEvent
Summary: Changelog: [Internal] Rename AccessibilityInfo.sendAccessibilityEvent_unstable to sendAccessibilityEvent In Fabric, we want people to use `AccessibilityInfo.sendAccessibilityEvent` instead of `UIManager.sendAccessibilityEvent` for Android. The API is not unstable. There is a test in [AccessibilityExample.js](https://github.com/facebook/react-native/blob/c940eb0c49518b82a3999dcac3027aa70018c763/packages/rn-tester/js/examples/Accessibility/AccessibilityExample.js#L959) in RNTester to confirm that it works. A search for [`AccessibilityInfo.sendAccessibilityEvent_unstable` in Github](https://github.com/search?q=AccessibilityInfo.sendAccessibilityEvent_unstable&type=Code) shows that it's not being used yet, which makes sense because it's an Fabric API. Therefore it's safe to rename it. Reviewed By: sammy-SC Differential Revision: D37901006 fbshipit-source-id: 73f35b09ca8f9337f4d66a431f0a3f815da38249
This commit is contained in:
committed by
Lorenzo Sciandra
parent
2de4cf03cf
commit
13a2b117be
@@ -345,7 +345,7 @@ const AccessibilityInfo: AccessibilityInfoType = {
|
||||
/**
|
||||
* Send a named accessibility event to a HostComponent.
|
||||
*/
|
||||
sendAccessibilityEvent_unstable(
|
||||
sendAccessibilityEvent(
|
||||
handle: ElementRef<HostComponent<mixed>>,
|
||||
eventType: AccessibilityEventTypes,
|
||||
) {
|
||||
|
||||
@@ -146,7 +146,7 @@ module.exports = {
|
||||
errorMessageForMethod('setLayoutAnimationEnabledExperimental'),
|
||||
);
|
||||
},
|
||||
// Please use AccessibilityInfo.sendAccessibilityEvent_unstable instead.
|
||||
// Please use AccessibilityInfo.sendAccessibilityEvent instead.
|
||||
// See SetAccessibilityFocusExample in AccessibilityExample.js for a migration example.
|
||||
sendAccessibilityEvent: (reactTag: ?number, eventType: number): void =>
|
||||
console.error(errorMessageForMethod('sendAccessibilityEvent')),
|
||||
|
||||
+1
-1
@@ -133,7 +133,7 @@ jest
|
||||
isScreenReaderEnabled: jest.fn(() => Promise.resolve(false)),
|
||||
removeEventListener: jest.fn(),
|
||||
setAccessibilityFocus: jest.fn(),
|
||||
sendAccessibilityEvent_unstable: jest.fn(),
|
||||
sendAccessibilityEvent: jest.fn(),
|
||||
getRecommendedTimeoutMillis: jest.fn(),
|
||||
},
|
||||
}))
|
||||
|
||||
@@ -956,7 +956,7 @@ function SetAccessibilityFocusExample(props: {}): React.Node {
|
||||
|
||||
const onPress = () => {
|
||||
if (myRef && myRef.current) {
|
||||
AccessibilityInfo.sendAccessibilityEvent_unstable(myRef.current, 'focus');
|
||||
AccessibilityInfo.sendAccessibilityEvent(myRef.current, 'focus');
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user