Diaglog with TextInput Infinite rerender #4176
kyusungpark
started this conversation in
General
Replies: 2 comments
-
I got same issue |
Beta Was this translation helpful? Give feedback.
0 replies
-
I was able to resolve this by putting the dialog in it's own component. This prevents the popover from re-rendering when the dialog's state changes (aka the text input value), which I think is causing the problem. Here's an example
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, I am trying to make a component Dialog that has a TextInput.
Below is my component and whenever I type, I realized that I get infinite rerenders.
import { Dispatch, SetStateAction } from 'react';
import { View } from 'react-native';
import { Button, Dialog, Portal, TextInput } from 'react-native-paper';
Seems like an issue with Provider. If I use Portal.Host infinite rerender goes away. But I am not sure why current home component is not getting context from provider when all other children are getting it without any problems.
Any direction/tips would be appreciated. Thank you!
Beta Was this translation helpful? Give feedback.
All reactions