Skip to content
Prev Previous commit
Next Next commit
update typescript example
  • Loading branch information
fabOnReact committed Feb 21, 2023
commit cc86a89634f69a4b84492fb7ee6656a9974ce08c
6 changes: 4 additions & 2 deletions docs/accessibility.md
Original file line number Diff line number Diff line change
Expand Up @@ -446,8 +446,10 @@ The supported event types are `typeWindowStateChanged`, `typeViewFocused`, and `
Android also supports `viewHoverEnter`.

```tsx
function SetAccessibilityFocusExample(props) {
const myRef = React.useRef(null);
function SetAccessibilityFocusExample(props: Props) {
const myRef = React.useRef<React.ElementRef<
typeof Text
> | null>(null);

const onPress = () => {
if (myRef && myRef.current) {
Expand Down