Make View render while swiping up with PanResponder - reactjs

I am able to change the position (swipe up) of my View accordingly with PanResPonder. The problem is during the swipe motion, the content of the View being dragged for the swipe do not render.
I tried using flexGrow:1 and flex:1 so as the View enlarge with the swipe, the View would be getting filled by content.
I know there a few libraries out there for swipes but I think this is fairly doable without library.
Thanks in advance cheers.

It really depends on your approach there. First things first.
You have to understand about JS Bridge and Native on react-native. The JSBridge is single-treaded and all the fired renders go through there. It means you can easily get dropped on FPS if you do not take it into account. The Native, well, is native code running, thats all.
To have performant app, you have to keep the passes over the bridge to a minimun.
The PanResponder touches happen on the native side, while the component renders use the bridge. You should put some code there, but i would bet that the problem is with too many renders happening and the JS Bridge gets overloaded.
Also try to use Direct Manipulation (https://facebook.github.io/react-native/docs/direct-manipulation.html) to avoit rendering one entire tree and perform it on the native side.

Related

How to check if a component appears after scroll to bottom in react native

I created a screen whose information is taken entirely from the database by APIs.
It has now been made so that all parts are loaded in 'componentWillMount' Lifecycle, and this has caused the loading speed of my screen to be very time consuming.
I want to design the screen in such a way that when the user scrolls down, it is checked whether the component appears on the screen or not. So if the desired component appears after scrolling down, I can call the functions of that component and get the information of that part from the APIs.
I do not know how to do this.
What is the best way to do this? Is there a library that can do this for me?
I spent about 2 hours searching for this goal but to no avail.
I also found libraries for ReactJS that unfortunately can not be used in React Native.
Thank you in advance for your support.

Is there a React Native utility for drag-to-expand panels?

I have a React Native App (using Expo) and I’m trying to implement a map/search layout similar to what is in Yelp or many other location-based hybrid map/search views (eg I checked all of the food related apps on my phone :slight_smile: McDonalds, Starbucks, DoorDash):
Specifically, I’m curious how to create that sort of draggable panel from the bottom, where you can drag it so that it overlaps the map.
Yelp/DoorDash technically have 3 states for this bottom panel: a completely collapsed state, an intermediate (default) state, and a completely expanded state, and you can even flick from completely collapsed to completely expanded.
Is there a standardized way to accomplish this with React Native? (I'm a little out-of-touch with the RN ecosystem.)
Ahh, here's a third party library where this behavior is implemented, and even the example in the documentation is off a map searchview. https://github.com/octopitus/rn-sliding-up-panel

How to access background while modal active in react-native-modal

I am trying to implement a page where top part of page is static and bottom part keeps on changing. I was able to achieve this using react-native-modal. But the problem is the back arrow button which is always supposed to be on the top of page becomes inaccessible entire time. I want to access the button even when modal is active.
Any help will be really appreciated cause it's not available anywhere, I went through the entire react native and react-native-modal docs related to this

How do I stop my ReactJS webite from twitching when I move my cursor?

A simple, one page view website, which I built on ReactJS started twitching anytime I moved my cursor. It seems like the browser width is changing, with a few pixels of margin added to the right, every time that happens. This doesn't seem to happen when viewing with the Chrome browser in mobile screen mode, under the developer tools. Which probably means it's as a result of the cursur interacting with the page. Has anyone encountered something similar?
It usually happens when you have an element that changes its width, padding, margin or border on hover or a Javascript event. This is not caused by React.
Please, share some css or JS you think may be involved to help more.
I found the bug, an animating component that kept touching the edge of the browser was the issue. I added some margin to the right of the component and the twitching stopped. Thanks to everyone for your help.

InfiniteContainer not working properly codenameone

I am using an infiniteContainer in codenameone but it doesn't seem to be working properly. When I load components onto the infinitecontainer for the first time it freezes and can't seem to scroll for more components to be displayed. The container also sometimes adds the endmarker half way when creating a component. Have been finding a workaround for months and it is really frustrating.

Resources