Skip to content
This repository has been archived by the owner on Sep 20, 2023. It is now read-only.

Commit

Permalink
fix: remove manual tracking of transition history and addition o… (#169)
Browse files Browse the repository at this point in the history
fix: remove manual tracking of transition history and addition of POP stat…
  • Loading branch information
TylerBarnes committed Dec 16, 2019
2 parents bb97d27 + af7b474 commit 30632a9
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 57 deletions.
20 changes: 6 additions & 14 deletions src/components/TransitionHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { Location } from '@reach/router'
import TransitionRenderer from './TransitionRenderer'
import delayTransitionRender from './delayTransitionRender'
import { Consumer } from '../context/createTransitionContext'
import { returnTransitionState } from '../utils/returnTransitionState'
import { onEnter } from '../functions/onEnter'
import { onExit } from '../functions/onExit'
import { getMs } from '../utils/secondsMs'
Expand All @@ -31,7 +30,6 @@ export default class TransitionHandler extends Component {
entryProps,
exitTrigger,
exitProps,
transitionIdHistory,
inTransition,
updateContext,
triggerResolve,
Expand Down Expand Up @@ -110,18 +108,12 @@ export default class TransitionHandler extends Component {
? states.entry
: states.exit

const transitionState = returnTransitionState(
{
inTransition,
location:
props.location,
transitionIdHistory,
transitionStatus,
current,
mount,
...states,
}
)
const transitionState = {
transitionStatus,
current,
mount,
...states,
}

const exitZindex =
exitProps.zIndex || 0
Expand Down
1 change: 0 additions & 1 deletion src/context/InternalProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ class InternalProvider extends Component {

this.state = {
inTransition: false,
transitionIdHistory: [],
disableAnimation: prefersReducedMotion.matches,
// event
e: false,
Expand Down
36 changes: 0 additions & 36 deletions src/utils/returnTransitionState.js

This file was deleted.

6 changes: 0 additions & 6 deletions src/utils/triggerTransition.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { navigate, withPrefix } from 'gatsby'
import random from 'lodash/random'
import { setTimeout } from 'requestanimationframe-timer'
import { getMs } from './secondsMs'
import getPagesPromises from './getPagesPromises'
Expand All @@ -10,7 +9,6 @@ const triggerTransition = ({
exit = {},
entry = {},
inTransition,
transitionIdHistory,
pages,
trigger,
updateContext,
Expand Down Expand Up @@ -78,19 +76,15 @@ const triggerTransition = ({

// after exitDelay
setTimeout(() => {
const transitionId = random(10000, 99999, false)

navigate(to, {
state: {
transitionId,
...linkState,
},
replace,
})

updateContext({
exitState: exitState,
transitionIdHistory: [...transitionIdHistory, transitionId],
hash,
})
}, getMs(exitDelay))
Expand Down

0 comments on commit 30632a9

Please sign in to comment.