'How to add cursor pointer to view via stylesehet in react native

I am new to React Native, been looking for an answer in google but could not find one. How can I add a cursor pointer to my View element with a nested TouchableOpacity element? I tried to use as property in stylesheet create method but got error that cursor in not a valid style property. Thank's in advance for any info.



Solution 1:[1]

The cursor is the mouse pointer, which is associated with the web browser and clicking links. Since React-Native is for mobile platforms, the typical situation is the user is tapping things with a finger, and so a 'cursor' or 'pointer' indicating the current mouse position is not necessary. The user just taps on the element.

I suggest using link styling, or button styling to indicate to the user that they can "click" specific text elements.

Solution 2:[2]

UPDATE

Web is now supported by react native, so just do

cursor: 'pointer'

Solution 3:[3]

For those using typescript

<View style={{
      alignItems:'flex-end',
      //@ts-ignore
      cursor:'pointer'
  }} >{text}</View>

Solution 4:[4]

use Link Tag instead of pointer cursor event to something using css in functional comnponent and calling on onclick event. in react when user hover to Link tag than it automatically showing cursor event. you dont need to specify cursor:'pointer';

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 ryan0
Solution 2 BloodyMonkey
Solution 3 Alex Totolici
Solution 4 Sundaram Gupta