Comments (5)
This seems to be a problem with hermes and it's relentless optimisation.
Depending on your setup, the call to registerSheet
may end up being passed an undefined
sheet which this library will then ignore, via this piece of code: https://github.com/ammarahm-ed/react-native-actions-sheet/blob/feb14334a0630df0e68bda85823ee90e6c6595c0/src/provider.tsx#L34C21-L34C21
What I think is happening is if hermes detects that the component you pass to registerSheet
is actually not being used in the overall component hierarchy, it will throw it away and set the component (or more precisely, all imports of it) to undefined
.
I have managed to "fix" it by having the code for the component and the registerSheet
call in the same place: an index.tsx
file. That way, hermes can't throw the component away as it is essentially being forced to run the piece of code.
from react-native-actions-sheet.
Ok after a little bit more of an investigation, I can confirm this works:
registerSheet("sheet", function Sheet() {
return (
<ActionSheet>
<Text>Hello</Text>
</ActionSheet>
);
});
So components need to be inlined, or declared in the same file as the registerSheet
call. Imports won't work.
It seems like either metro/babel or hermes is aggressively removing components that are not directly a part of the component hierarchy. I'm not sure what the library author can do about this other than a huge refactor, and I'm also not sure if there are some compiler hints to not remove components (if they are being removed at compile stage).
But in any case, there is a workaround.
from react-native-actions-sheet.
SheetManager is not working in react-antive 0.73.1 version. These action sheets cannot be managed with the provider. When SheetManager.show('sheetname') is run, no response is received. Since this feature does not work, sheets can be intervened with ref.
How can the Sheetmanager issue be resolved?
The issue is present in all 3 versions: 0.8.10, 0.8.29 and 0.9.0-alpha.24.
I think I fixed it by installing @shopify/flash-list in my project.
from react-native-actions-sheet.
I am already creating registerSheet and I am sure that it is correct. SheetManager does not give any reaction or error even though everything is correct in version 0.73.1. That's why I couldn't fully understand what you said. I mentioned the unresponsiveness of the SheetManager.show function.
from react-native-actions-sheet.
The error given when I do not have this library installed in my @shopify/flash-list project is different. Unfortunately, I can't get any errors. There is just a lack of reaction.
from react-native-actions-sheet.
Related Issues (20)
- No params passed to initial route
- No params passed to initial route
- Not working in release mode with new arch enabled (72.6) HOT 1
- [commonjs--resolver] Unexpected token => node_modules/react-native-actions-sheet/dist/src/index.js:785:12
- Uncaught TypeError: _a2.setNativeProps is not a function HOT 7
- Strange actions sheet behaviour on Android HOT 8
- How to limit max expanded height? HOT 8
- Transparent background color HOT 4
- Bottomsheet goes out of the screen in landscape mode HOT 1
- Android does not overlap the navigation bar HOT 4
- Cannot open action sheet again when using closable={false}
- [0.9.1] closing sheet with keyboard open, resizing screens HOT 1
- Action sheet does not show 100% of the screen size. HOT 1
- 🆘 An important issue on Release Build with react-native-reanimated HOT 2
- `snapPoints` in Sheet router
- [BUG] IOS Crashes When Using this package with Webview HOT 1
- Navigating to a modal screen from action sheet causes issues in iOS with React Native 0.73 HOT 1
- [BUG] undefined value appears in the console when property animation={false} of the ActionSheet
- Is something similar to react-native's Modal presentationStyle="pageSheet" supported? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-native-actions-sheet.