expo / expo/react-native-action-sheet

Doesn't work with react-native version 0.72.6 with fabric enabled on Android physical device

Open
#318 2 comments 3 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
1.6k
Forks
223
PR merge metrics
No merged PRs in 30d

Description

ISSUE: On react-native version 0.72.6 with fabric enabled, action sheet on Android physical device doesn't open reliably and the onPress events are never triggered. The package works with the latest version of RN (currently 0.73.2) but does not work with RN version 0.72.6.

SETUP:
npx react-native@0.72.6 init TestProject --version 0.72.6

Enable new architecture (for android, in gradle.properties set newArchEnabled=true)

In package.json, your versions should look like:
"react-native": "0.72.6"
"@expo/react-native-action-sheet": "^4.0.1",

Sample code for App.tsx:

```
import React from 'react';
import {SafeAreaView, Text, TouchableOpacity} from 'react-native';
import {
ActionSheetProvider,
useActionSheet,
} from '@expo/react-native-action-sheet';

const ActionSheetComponent = () => {
const {showActionSheetWithOptions} = useActionSheet();
const onPress = () => {
const options = ['Delete', 'Save', 'Cancel'];
const destructiveButtonIndex = 0;
const cancelButtonIndex = 2;
showActionSheetWithOptions(
{
options,
cancelButtonIndex,
destructiveButtonIndex,
},
selectedIndex => {
switch (selectedIndex) {
case 1:
console.log('Save--->>>>>>');
break;
case destructiveButtonIndex:
console.log('Delete--->>>>>>');
break;
case cancelButtonIndex:
console.log('Cancel--->>>>>>');
}
},
);
};
return (

Open Action Sheet

);
};

function App(): React.JSX.Element {
return (





);
}

export default App;
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.