react-native-popover | A Popover / component | Frontend Framework library
kandi X-RAY | react-native-popover Summary
kandi X-RAY | react-native-popover Summary
A component for react-native
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Constructs a new Rect object .
- Point constructor .
- Create a new size object .
react-native-popover Key Features
react-native-popover Examples and Code Snippets
Community Discussions
Trending Discussions on react-native-popover
QUESTION
I started learning React Native 2 weeks ago and I got at the installing plugins chapter. I installed react-native-popover-view and I don't know but for me I get the error:
Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops.
I searched around and after staying 2 days on this I understood that I have setState in render(), because I have the Modal in App render(). I tried to figure out how to change it, but without success.
So I have the Modal.js class:
...ANSWER
Answered 2019-Aug-14 at 06:59This error is due to when you call onPress={this.closePopover()}
on Image , it calls the function and causes the app to re-render which again causes function to be invoked, and hence an infinite loop. The best way would be calling it directly without parentheses onPress={this.closePopover}
or create an anonymous function onPress={() => this.closePopover()}
, which gets executed only once
QUESTION
I am using this tooltip for displaying some information. When one of the options is clicked, I want to show the next tooltip. The way this transitioning has been set up by the library author is through ref
s, and in this case, the refs work well when they are string literals. However, string literals are deprecated in React16+.
The workaround is to use createRef
and I did that. It works for the first popup, but fails when having to transition because this
refers to the immediate object it is used in.
Below is the code I have written. How can I change it such that this
refers to the correct object?
ANSWER
Answered 2018-Jun-07 at 23:10Try to bind the click function like this.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install react-native-popover
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page