简体   繁体   中英

Typing out all possible strings to use accessibilityRole?

I'm using accessibilityRole in React Native. Do I have to type out all the possible strings, or is there an import that I can use?

createAccessibilityRole(parent: Element): string {
  if(isLink) return 'link'
  return 'text'
}

Obviously the above doesn't work, so I was wondering if we could import the type class or if we have to code it ourselves?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM