Created
January 18, 2020 07:51
-
-
Save tsangpo/76c8b53e2d01245774dad7db0b0d2d86 to your computer and use it in GitHub Desktop.
Example of preact TransitionRouter
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment