-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
[1.0] build example site with fancy page transitions #925
Comments
I'm actually working on implementing something with Any ideas on how to do that?
For both, the pages render fine, but I haven't been able to get TransitionGroup's lifecycle hooks to work. |
I'm not really sure how TransitionGroup works but I'd love to get things working such that there could be plugins which auto add transition effects (perhaps have 5-6 diff options) to a site or to individual pages. |
Also this will effect things #940 |
*affect |
Ah crap. I for some reason thought Gatsby had already changed to RR V4. That's probably part of the problem :) I will keep plugging away and report back findings. The TransitionGroup functionality seems to have changed in a recent update to React, and it's been moved to a new repo with new maintainers, so I'm sure that's also part of my misunderstanding. |
Check back tomorrow and it might be! :-)
…On Tue, May 9, 2017, 2:27 PM Anthony Sapp ***@***.***> wrote:
Ah crap. I for some reason thought Gatsby had already changed to RR V4.
That's probably part of the problem :)
I will keep plugging away and report back findings. The TransitionGroup
functionality seems to have changed in a recent update to React, and it's
been moved to a new repo with new maintainers, so I'm sure that's also part
of my misunderstanding.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#925 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAEVh6c5avDIqyy2nP3xrJPtQNPesHV9ks5r4NojgaJpZM4NSIlb>
.
|
@KyleAMathews so after some more digging I've definitely figured out what needs to be done to implement this type of transition at the page level. I think an elegant way to do this would be to wrap the component for each page you want to transition in a TransitionGroup component. I'm having a crack at doing this using a HOC at the moment. |
After reading the plan for #940 , I think it's best to wait to do any further implementation of this. I did figure it out, though. I'll have a crack at explaining it, so perhaps it will help in some way with the changes that are coming. What I ultimately found is that I needed to interact with the components that are generated for each page in the
I know that <children.type/> is the component Gatsby derives, and the So the problem from there was, TransitionGroup calls lifecycle methods in the component it's wrapping... so it's going to try to call them in the derived component in Helper script
Then, in
TransitionGroup now works as expected, with the ability to map its lifecycle hooks to any page template component, and do custom animations with EG Hopefully that makes some kind of sense :) |
In messing around with this some more this morning, I realized this method doesn't work when doing a production build... I still think the above post might be useful though, hopefully. |
#940 is merged now btw. Since this.props.children is a function now for layouts, perhaps that can be leveraged for this? |
Cool, I will have a look. |
So much better! I was able to get something workable going. If I go to the root route first, everything works fine. Seems like it might have something to do with code splitting not loading a required file, but I'm not 100% sure. |
I've been experiencing this issue too, but hadn't investigated enough to report it yet. Not sure how long has been there but I suspect since the router v4 update. @KyleAMathews Should we maybe make a separate issue for it? Or do you have this on your radar already? |
Do you have a layout component? At layouts/index.js?
…On Tue, May 16, 2017, 10:53 PM Thijs Koerselman ***@***.***> wrote:
I've been experiencing this issue too, but hadn't investigated enough to
report it yet. Not sure how long has been there but I suspect since the
router v4 update.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#925 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAEVhxF_gJ9BVl3tmLwF-aOaJge28MyOks5r6gy1gaJpZM4NSIlb>
.
|
@KyleAMathews Yes |
Yes, at layouts/index.js |
Afaik none of the example apps do this. If you can help narrow down things
more. Also what is that line of code?
…On Tue, May 16, 2017, 11:58 PM Anthony Sapp ***@***.***> wrote:
Yes, at layouts/index.js
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#925 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAEVh0n-8mEEqpLPjx57SOpv8a4L9WsIks5r6hvxgaJpZM4NSIlb>
.
|
@KyleAMathews of course, apologies for being vague. I will have a closer look tomorrow and report back. Worth opening a new issue? |
Yeah sounds like it |
Any progress on this? is it possible now? |
☝️ |
Per @sebastienfi comment, we've got solid support now for page transitions — would love a really fancy example site too someday but this will suffice for now. |
Hi guys, is anyone using scroll-to-anchor animations? I am having weird rendering-issues with https://www.npmjs.com/package/react-anchor-link-smooth-scroll |
Did somebody use react-spring / react-motion / pose for more sophisticated transitions between pages? Are there any examples on integration gatsby with those libraries? Ideally I'd morph one page into another like this. Transition-In is no-brainer, but I'm not sure how can I transition-Out or cross-fade. |
Something like this would be 💯
https://codepen.io/sdras/full/gWWQgb/?utm_source=reactnl&utm_medium=email
The text was updated successfully, but these errors were encountered: