MovieHunt | Movie Android App written in Kotlin MVVM RxJava | Architecture library
kandi X-RAY | MovieHunt Summary
kandi X-RAY | MovieHunt Summary
MovieHunt is a sample Android project using The Movie DB API based on MVVM architecture. It showcases the latest Android tech stacks with well-designed architecture and best practices.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of MovieHunt
MovieHunt Key Features
MovieHunt Examples and Code Snippets
Community Discussions
Trending Discussions on MovieHunt
QUESTION
I am trying to do the pagination part in my app, however the data is correct, but the only issue is when I try to call or show a component i.e Trending.jsx on click of a button(Most Popular) and ( type of toggle button), at first it gets the correct page number, but when I hide that Trending.jsx component the page numbers remains the same, on my default page/component which is Movie.jsx
However, I want to reset page number if the component is not shown and start from 1 when a user clicks to see Trending.jsx and viceVersa
Please see the link to code sand box for the code I tried. https://codesandbox.io/s/moviehunt-demo-forked-rhom0?file=/src/components/Movies/Movies.jsx
Full live app: https://rhom0.csb.app/movies
Thanks for the help.
...ANSWER
Answered 2022-Jan-31 at 13:31As far as I understood, the problem is that when toggling back & forth between Movies & Trending, the Page Number is not getting reset to 1.
So, I created a useEffect with dependency on the state: showTrending in which I'm just updating the page number back to 1.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install MovieHunt
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