-
-
Notifications
You must be signed in to change notification settings - Fork 71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Only render iOS preview component when opening the action menu #110
Comments
can you show a screenshot or screen recording? |
Running into the same thing as well.
@mpiannucci this is a breakdown of what I'm seeing: TLDR: Putting a console.log inside the dropdown preview component shows console many console logs when rendering a ContextMenu as a list item. Let's say we have a component TransactionView we want as the preview:
We put it as the preview like so for TransactionListItem:
Now when we use the TransactionListItem in eg a FlatList:
We see the TransactionView rendered many times without actually opening the preview, like this:
This will cause quite a lot of lag if the TransactionView is a heavy component. Perhaps there's some way to lazy load the preview only on long press etc? |
Would it be possible to only render the
preview
component, when the user opens the action menu (the component becomes visible)?I'm currently developing a notes like app, where I have a FlatList of ContextMenu items for each note item. When the user opens the context menu, he can view a preview of the note. This preview component is pretty expensive to render (richt text support, Latex, etc.).
Currently, all preview components get rendered simultaneously to the children of the ContextMenu.
A delayed render of the preview item would greatly improve performance for such a use case. An alternative would be to provide a callback prop which is called when the preview item gets rendered (e.g.
onPreviewWillShow: (event) => void
oronMenuWillShow
).Maybe there is also a workaround which would make it possible to check if the component is visible from inside the preview component, but I could not find a solution.
The text was updated successfully, but these errors were encountered: