question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

react-native 0.62.x removed accessibilityStates

See original GitHub issue

Environment

  • react: 16.11.0
  • react-native: 0.62.2
  • react-native-paper: 3.10.1
  • typescript: 3.9.2

Description

Remove accessibilityStates: We’ve removed the deprecated accessibilityStates property in favor of the new accessibilityState prop which is a more semantically rich way for components to describe information about their state to accessibility services. – https://reactnative.dev/blog/#breaking-changes

image

Reproducible Demo

Code:

import React from "react"
import { View } from "react-native"
import { Text } from "react-native-paper"

interface Props {}

const Component: React.FC<Props> = () => {
  return (
    <View>
      <Text>Component</Text>
    </View>
  )
}

export default Component

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:30
  • Comments:10 (3 by maintainers)

github_iconTop GitHub Comments

8reactions
firedecommented, May 23, 2020

A way to IGNORE errors using patch-package:

diff --git a/node_modules/@types/react-native/index.d.ts b/node_modules/@types/react-native/index.d.ts
index 98681f1..825c536 100644
--- a/node_modules/@types/react-native/index.d.ts
+++ b/node_modules/@types/react-native/index.d.ts
@@ -2069,6 +2069,7 @@ export interface AccessibilityProps extends AccessibilityPropsAndroid, Accessibi
      * Accessibility State tells a person using either VoiceOver on iOS or TalkBack on Android the state of the element currently focused on.
      */
     accessibilityState?: AccessibilityState;
+    accessibilityStates?: any; // react-native-paper 3.x
     /**
      * An accessibility hint helps users understand what will happen when they perform an action on the accessibility element when that result is not obvious from the accessibility label.
      */

Put this file to patches/@types+react-native+0.62.11.patch, run yarn patch-package.

NOTE: This just ignores the error, accessibilityStates does not work as expected.

4reactions
GoMinocommented, May 18, 2020

This is a real issue

Read more comments on GitHub >

github_iconTop Results From Across the Web

Announcing React Native 0.62 with Flipper
Today we're releasing React Native version 0.62 which includes ... We've removed the deprecated accessibilityStates property in favor of the ...
Read more >
ReactNative 0.62.x版本新特性整理_xy371661665的博客
This is the first diff in the series. It removes Flow types for this feature to verify that we actually do not have...
Read more >
Custom jest matchers to test the state of React Native - Morioh
It also works with accessibilityStates={['disabled']} for now. However, this prop is deprecated in React Native 0.62 ...
Read more >
React Native version mismatch - Stack Overflow
just force react native version in your android's app level gradle file, ... Discard your changes, delete and reinstall your Node modules, ...
Read more >
react-native: Versions - Openbase
This version is a patch release addressing the Android build issue that has been ongoing since Nov 4th 2022. If you are on...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found