Comments (11)
thank you - I can reproduce the bug now. We will need some time to fix it properly however here is small workaround - wrap your router definition so that it does not rerender like
<Provider store={store}>
<MenuContext style={{ flex: 1 }}>
<StaticRenderer>
<RouterComponent />
</StaticRenderer>
</MenuContext>
</Provider>
example implementation of StaticRenderer
class StaticRenderer extends Component {
shouldComponentUpdate() {
return false;
}
render() {
return React.Children.only(this.props.children)
}
}
from react-native-popup-menu.
as far I have seen the bug - it has side effects (remounting of menu) if the router is not shielded from MenuContext. Unless you have something else "above" the router that might change the router definition somehow - it is safe to wrap router.
Right now we are working on refactoring of our internals so that such workarounds are not needed but we need more time for it.
from react-native-popup-menu.
@sodik82 I'm sorry for the late response but I can confirm it indeed works without the workaround for me. Cheers 👍
from react-native-popup-menu.
Thank you. I have tried simplified example and seems to work:
<Provider store={store}>
<MenuContext style={{ flex: 1 }}>
<Testing />
</MenuContext>
</Provider>
Maybe if you can share with us details about your used navigation (which library, sample setup)? Or maybe if you can confirm first if it works without the Router
?
from react-native-popup-menu.
For navigation I'm using [email protected] with the following setup on the Router:
const RouterComponent = () => (
<Router>
<Scene hideNavBar>
<Stack key="auth" initial>
<Scene
key="testing"
component={Testing}
title="Testing"
initial
/>
{/*... */}
</Stack>
{/*... */}
</Scene>
</Router>
);
EDIT: Ok, I tried it without the Router and it's working. Any idea as to why?
from react-native-popup-menu.
I'm fairly new to React Native, so forgive my ignorance when I ask you:
Will wrapping the router as suggested have any other (side-)effects?
Anyways, thanks for the fast response and fix! 👍
from react-native-popup-menu.
@Hugainz - new version 0.8.2
should work without any workarounds. can you confirm it?
from react-native-popup-menu.
it's not working. I have the new version 0.8.3
from react-native-popup-menu.
can you provide us more details? does it work with workaround? what error/unexpected behaviour do you get? more details about your setup?
from react-native-popup-menu.
I will give a try again, thanks for the feedback.
from react-native-popup-menu.
@mohamed-alashry - thanks. maybe it is unrelated problem (maybe #41 ). but if you have any more information about your problem we can resolve it.
from react-native-popup-menu.
Related Issues (20)
- Did the full description of API disappear? HOT 2
- Unable to find MenuOption by testID HOT 3
- Popover keeps shaking HOT 3
- Is it possible to restyle how the menu looks all together?
- Incorect Position When Use FlatList in the Modal HOT 1
- Unable To Set Custom Touchable Styles HOT 2
- Basic menuitem not showing HOT 1
- how to close menu popup after selecting any item from the menu? HOT 1
- Is this library support props testID and accesibilityLabel for Detect the component with Appium Inspector ? HOT 1
- popup menu in conjunction with react-native-navigation produces warnings HOT 2
- Use it in expo, Android side opens with an error, ios can use
- MenuOption testID type error HOT 1
- 🐞 Subtitle not showing on the Menu items HOT 1
- RN v0.72 click on menu item works on Android emulator with mouse but doesn't work in phone with touch
- In the renderer, pass the close function to which component through props to execute the exit animation HOT 1
- how to adjust popover styles?
- Incorrect position when using in FlashList HOT 7
- "Menu name cannot be changed" error when dynamically updating FlatList (or FlashList) HOT 1
- [Bug] Cannot read property 'instance' of undefined HOT 1
- Issue with MenuProvider Causing Overlay During Automation Testing on iOS
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-popup-menu.