Skip to content

Commit

Permalink
fix(state): reset history helper for tests and babel warning fix
Browse files Browse the repository at this point in the history
release-npm
  • Loading branch information
tobua committed Oct 13, 2024
1 parent 799296c commit f31e502
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 3 additions & 1 deletion index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,16 @@ import { Animated, View, BackHandler, TouchableOpacity } from 'react-native'
import { styles } from './styles'
import startTransition, { initialPosition, connect, isTransitioning, isTransitionValid } from './transition'
import { CustomTransition } from './animations'
import { Transition, Screen, State, TransitionInput, ScreenProps } from './types'
import { Transition, Screen, State, TransitionInput, type ScreenProps } from './types'

export { Transition, CustomTransition, type ScreenProps }

// All the registered screens.
const screens: { [key: string]: Screen } = {}
// History of the screens visited.
export const history: Screen[] = []
// Useful for tests when rerendering, but not back on first screen.
export const reset = () => history.splice(0, history.length, history[0])

// React hook: const screen = useCurrentScreen()
const currentScreenHookListeners: ((screen: string) => void)[] = []
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
"@react-native/babel-preset": "^0.75.4",
"@react-native/eslint-config": "^0.75.4",
"@react-native/typescript-config": "^0.75.4",
"@types/bun": "^1.1.10",
"@types/bun": "^1.1.11",
"@types/jest": "^29.5.13",
"@types/node": "^22.7.4",
"@types/node": "^22.7.5",
"@types/react": "^18.3.11",
"@types/react-native": "^0.73.0",
"@types/react-test-renderer": "^18.3.0",
Expand All @@ -34,7 +34,7 @@
"react": "^18.3.1",
"react-native": "^0.75.4",
"react-test-renderer": "^18.3.1",
"typescript": "^5.6.2"
"typescript": "^5.6.3"
},
"peerDependencies": {
"react": ">= 18",
Expand Down

0 comments on commit f31e502

Please sign in to comment.