Closed xbreid closed 6 years ago
Hi @bar0191 , Thanks for your issue. I'll take a look soon and will give you an answer.
Hi, @bar0191 . Sorry for this delay, was busy. I found where the problem is and will try to fix it during this week.
Any luck on the fix?
@bar0191 @marquez138 Finally I have fixed this. Can you please take a look if all is fine now? https://github.com/VikLiegostaiev/react-page-scroller/tree/1.4.0
Now it should rerender your components after state changes.
Thats great really appreciate the work on this component. I'm a bit new to react and was wondering how I would be able to add animations to the state changes as mentioned above by bar0191, would you be kind enough to point me in the right direction? I would really like to use either GSAP or Popmotion/Pose for the enter/leave animations. Any help would be greatly appreciated
@marquez138 pageOnChange event is called before page changes. You can pass pageOnChange callback to props and set the local state of your component inside of this callback. After set change your components are rerendered and you can do any action in e.g. componentDidUpdate. See docs for more info because I am not familiar with the libraries you've mentioned.
That helps alot thanks again!
Is it possible to show an example of how you write this on the FirstComponent? I thought i would be able to by myself but im really stuck. Thanks
Hello, I've been playing with your component and love that it's working with SSR so far.
I did notice however, that when attempting to change the state on any component inside the PageScroller wrapper when an onPageChange occurs nothing happens. I'm assuming that since these components are children on the parent PageScroller component there is nothing in the parent to trigger the state change.
I'm essentially trying to create onEnter and onExit entrance animations for each page component wrapped in the PageScroller. So when you re-enter the page component, an entrance animation will re-occur.
I'm wondering if there is a way to achieve this functionality, or a way to trigger a state change in those child components?