diff --git a/index.tsx b/index.tsx index 2625e17..2493c0e 100644 --- a/index.tsx +++ b/index.tsx @@ -41,7 +41,7 @@ export const useCurrentScreen = () => { // Register a screen. export const register = ( - Component: JSX.Element, + Component: React.JSX.Element, name: string, configuration: { transition?: TransitionInput; background?: string; initial?: boolean } = { transition: Transition.regular, @@ -231,7 +231,7 @@ const renderScreen = (screen: Screen, state: State) => { ) } -function orderScreens(existingScreens: JSX.Element[], state: State) { +function orderScreens(existingScreens: React.JSX.Element[], state: State) { existingScreens.sort((firstScreen, secondScreen) => { const firstName = firstScreen.props['aria-label'] const secondName = secondScreen.props['aria-label'] diff --git a/package.json b/package.json index d3a49a1..43cc07f 100644 --- a/package.json +++ b/package.json @@ -14,27 +14,27 @@ "types": "tsc && tsc --noEmit --project ./test/tsconfig.json" }, "devDependencies": { - "@react-native-community/cli": "^14.1.1", - "@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.11", - "@types/jest": "^29.5.13", - "@types/node": "^22.7.5", - "@types/react": "^18.3.11", + "@react-native-community/cli": "^15.1.3", + "@react-native/babel-preset": "^0.76.5", + "@react-native/eslint-config": "^0.76.5", + "@react-native/typescript-config": "^0.76.5", + "@types/bun": "^1.1.14", + "@types/jest": "^29.5.14", + "@types/node": "^22.10.2", + "@types/react": "^19.0.1", "@types/react-native": "^0.73.0", - "@types/react-test-renderer": "^18.3.0", + "@types/react-test-renderer": "^19.0.0", "babel-jest": "^29.7.0", "cpx": "^1.5.0", "eslint": "8.57.0", "eslint-plugin-flowtype": "^8.0.3", "eslint-plugin-prettier": "^5.2.1", "jest": "^29.7.0", - "prettier": "^3.3.3", - "react": "^18.3.1", - "react-native": "^0.75.4", - "react-test-renderer": "^18.3.1", - "typescript": "^5.6.3" + "prettier": "^3.4.2", + "react": "18.3.1", + "react-native": "^0.76.5", + "react-test-renderer": "18.3.1", + "typescript": "^5.7.2" }, "peerDependencies": { "react": ">= 18", diff --git a/test/utils/render-to-tree.ts b/test/utils/render-to-tree.ts index 1c3b96f..7b49a13 100644 --- a/test/utils/render-to-tree.ts +++ b/test/utils/render-to-tree.ts @@ -1,7 +1,8 @@ /* eslint-env jest */ +import type React from 'react' import renderer, { ReactTestRenderer, act } from 'react-test-renderer' -export default (Navigation: JSX.Element) => { +export default (Navigation: React.JSX.Element) => { let rendered: ReactTestRenderer | null = null // act to ensure effects are flushed in initial render. act(() => { diff --git a/types.ts b/types.ts index d66ea8c..3904740 100644 --- a/types.ts +++ b/types.ts @@ -1,3 +1,4 @@ +import type React from 'react' import type { Animated } from 'react-native' export type AnimationHandler = (state: State, done: () => void, reverse?: boolean) => (() => void) | null @@ -23,7 +24,7 @@ export type TransitionInput = Transition | TransitionString | Animation export type Screen = { name: string - Component: JSX.Element + Component: React.JSX.Element transition: TransitionInput background: string props?: Object @@ -41,5 +42,5 @@ export type State = { Top: Screen Bottom?: Screen reverse?: boolean - renderedScreens: { [key: string]: { screen: Screen; props: Props; view?: JSX.Element } } + renderedScreens: { [key: string]: { screen: Screen; props: Props; view?: React.JSX.Element } } }