Skip to content
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

Route Transitions with Pose #172

Open
MrLoh opened this issue Sep 5, 2018 · 11 comments
Open

Route Transitions with Pose #172

MrLoh opened this issue Sep 5, 2018 · 11 comments
Labels

Comments

@MrLoh
Copy link

MrLoh commented Sep 5, 2018

Feature Request

Problem Description

I was trying to setup After.js with Custom Route transitions, using Posed, as described in this article:
https://popmotion.io/pose/learn/route-transitions-react-router/

Unfortunately Pose just works properly, if the Switch component can be wrapped directly and is passed a location prop explicitly. Which is not possible by default with After.js

Suggested Solutions

I got it working by forking the implementation of the After component to allow me to wrap the Switch component directly in a transition container (see https://github.com/MrLoh/afterjs-apollo-rnw-styled-pose-example/blob/master/src/AfterWithTransition.js)

This is obviously not a great solution. Maybe it would be possible to pass a Wrapper component to the After component to prevent this issue. Since the After component is only used explicitly on the client, this introduces more complexity though.

I could imagine, that it would be easier, if the interface for customRenderer also explicitly uses the After component and requires also setting the StaticRouter manually. This would also help in setting up content for all routes like a header outside of the router switch, which currently isn't possible on the server.

I'd be happy to come up with a PR, but this should be discussed first, as it deals with the architecture of After.


@jaredpalmer
Copy link
Owner

Yes. Just like gatsby 2, lack of a layout component makes this impossible. Let’s fix it

@MrLoh
Copy link
Author

MrLoh commented Sep 5, 2018

Maybe the easiest way would be to pass a layout component to both After and to render (just like document). I think that should work for both: non switch routes and transitions.

@MrLoh
Copy link
Author

MrLoh commented Sep 5, 2018

@jaredpalmer I whipped up a quick PR #173 of how this could work

@stale
Copy link

stale bot commented Nov 4, 2018

Hola! So here's the deal, between open source and my day job and life and what not, I have a lot to manage, so I use a GitHub bot to automate a few things here and there. This particular GitHub bot is going to mark this as stale because it has not had recent activity for a while. It will be closed if no further activity occurs in a few days. Do not take this personally--seriously--this is a completely automated action. If this is a mistake, just make a comment, DM me, send a carrier pidgeon, or a smoke signal.

@stale stale bot added the stale label Nov 4, 2018
@MrLoh
Copy link
Author

MrLoh commented Nov 4, 2018

There’s a PR in flight for this, so it’s not stale.

@stale stale bot removed the stale label Nov 4, 2018
@stale
Copy link

stale bot commented Jan 3, 2019

Hola! So here's the deal, between open source and my day job and life and what not, I have a lot to manage, so I use a GitHub bot to automate a few things here and there. This particular GitHub bot is going to mark this as stale because it has not had recent activity for a while. It will be closed if no further activity occurs in a few days. Do not take this personally--seriously--this is a completely automated action. If this is a mistake, just make a comment, DM me, send a carrier pidgeon, or a smoke signal.

@stale stale bot added the stale label Jan 3, 2019
@MrLoh
Copy link
Author

MrLoh commented Jan 3, 2019

PR pending

@stale stale bot removed the stale label Jan 3, 2019
@MiYogurt
Copy link

MiYogurt commented Feb 5, 2019

God, to solve the Layout problem and routing animation problem, I need to modify most of the After. JS files.

image

React is very difficult to insert in After. JS at some level.

I thnik in customRenderer function should pass {route, data} params. let user can self replace After.tsx or After.tsx add some wrap component interface。

@fa7ad
Copy link

fa7ad commented Jul 7, 2020

Hey people, did anybody ever figure out a simple solution to this?

@MrLoh
Copy link
Author

MrLoh commented Jul 7, 2020

yes, switching to next, haven't regretted it for a second

@fa7ad
Copy link

fa7ad commented Jul 8, 2020

That doesn't sound like a solution. Specially with that horrible routing system.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants