diff --git a/Libraries/Components/ScrollView/ScrollViewStickyHeader.js b/Libraries/Components/ScrollView/ScrollViewStickyHeader.js index 76485c76af20..715c8cbfaa6e 100644 --- a/Libraries/Components/ScrollView/ScrollViewStickyHeader.js +++ b/Libraries/Components/ScrollView/ScrollViewStickyHeader.js @@ -181,7 +181,7 @@ class ScrollViewStickyHeader extends React.Component { // Fabric Detection // eslint-disable-next-line dot-notation const isFabric = !!( - this._ref && this._ref['_internalInstanceHandle']?.stateNode?.canonical + this._ref && this._ref._internalInstanceHandle?.stateNode?.canonical ); // Initially and in the case of updated props or layout, we diff --git a/RNTester/js/examples/Accessibility/AccessibilityExample.js b/RNTester/js/examples/Accessibility/AccessibilityExample.js index 38fa2b3cdb24..30a0537bab3f 100644 --- a/RNTester/js/examples/Accessibility/AccessibilityExample.js +++ b/RNTester/js/examples/Accessibility/AccessibilityExample.js @@ -750,6 +750,62 @@ class AnnounceForAccessibility extends React.Component<{}> { } } +class DisplayOptionsStatusExample extends React.Component<{}> { + render() { + return ( + + + + + + + + ); + } +} + +function DisplayOptionStatusExample({optionName, optionChecker, notification}) { + const [statusEnabled, setStatusEnabled] = React.useState(false); + React.useEffect(() => { + AccessibilityInfo.addEventListener(notification, setStatusEnabled); + optionChecker().then(isEnabled => { + setStatusEnabled(isEnabled); + }); + return function cleanup() { + AccessibilityInfo.removeEventListener(notification, setStatusEnabled); + }; + }, [optionChecker, notification]); + return ( + + + {optionName} + {' is '} + {statusEnabled ? 'enabled' : 'disabled'}. + + + ); +} + exports.title = 'Accessibility'; exports.description = 'Examples of using Accessibility APIs.'; exports.examples = [ @@ -783,6 +839,12 @@ exports.examples = [ return ; }, }, + { + title: 'Check if the display options are enabled', + render(): React.Element { + return ; + }, + }, { title: 'Check if the screen reader announces', render(): React.Element {