question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

preact-router and preact-transition-group

See original GitHub issue

Hi, first of all thanks for Preact and its tooling, it’s really great. 👍

I’m looking to add preact-transition-group to my routing so that each component can handle componentWillEnter, componentWillAppear and componentWillLeave.

So far I haven’t found a clean way of integrating these two together without patching this module.

https://github.com/Jam3/preact-router/commit/966d4f227c5ae3ab23bf311f2dab86f0dd9761fb#diff-1fdf421c05c1140f6d71444ea2b27638L248

Is there another way this might be possible?

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:1
  • Comments:12 (4 by maintainers)

github_iconTop GitHub Comments

4reactions
mattdeslcommented, May 11, 2017

Thanks, for now I am happy to use my fork. We eventually might clean it up a bit and re-release it with more documentation on transitions, as an alternative to preact-router for more specialized animated apps.

Cheers. 😄

3reactions
danallowaycommented, Sep 21, 2017

@mattdesl would extending the router work for you?

import { h } from 'preact';
import Router from 'preact-router';
import TransitionGroup from 'preact-transition-group';

export default class TransitionRouter extends Router {
    render(props, state) {
        return (
            <TransitionGroup component="div">
                {super.render(props, state)}
            </TransitionGroup>
        );
    }
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

preact-router and preact-transition-group · Issue #187 - GitHub
I'm looking to add preact-transition-group to my routing so that each component can handle componentWillEnter , componentWillAppear and ...
Read more >
how can i create a page transition with preact - Stack Overflow
It would be something like: import { h, FunctionComponent } from 'preact'; import Router from ...
Read more >
Usage with React Router - React Transition Group
The main challenge is the exit transition because React Router changes to a new route instantly, so we need to keep the old...
Read more >
preact-render-to-string vs preact-router vs preact-transition-group ...
preact-render-to-string vs preact-router vs preact-transition-group. Popular Searches. @angular/core vs angular vs react vs vue · angular vs react vs vue ...
Read more >
preact-transition-group - npm
A preact-aliased version of react-addons-transition-group, originally extracted from the React codebase, refactored to ES2015 and converted ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found