Skip to content

Commit

Permalink
Merge pull request #38 from koordinates/useIsRouteActive
Browse files Browse the repository at this point in the history
  • Loading branch information
UberMouse authored Dec 6, 2022
2 parents 277866f + 9b7b689 commit 8f9a4d4
Show file tree
Hide file tree
Showing 17 changed files with 153 additions and 201 deletions.
2 changes: 1 addition & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module.exports = {
setupFilesAfterEnv: ["./src/setupScript.ts"],
globals: {
"ts-jest": {
tsConfig: "./tsconfig.json",
tsconfig: "./tsconfig.json",
isolatedModules: true,
},
},
Expand Down
205 changes: 17 additions & 188 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"@saithodev/semantic-release-backmerge": "^2.1.2",
"@testing-library/dom": "^8.14.0",
"@testing-library/jest-dom": "^5.16.1",
"@testing-library/react": "^10.4.8",
"@testing-library/react": "^13.4.0",
"@testing-library/user-event": "^13.5.0",
"@types/history": "^4.7.7",
"@types/jest": "^28.1.4",
Expand Down Expand Up @@ -73,7 +73,8 @@
"peerDependencies": {
"@xstate/react": "^3.x",
"xstate": ">= 4.20 < 5.0.0",
"zod": "^3.x"
"zod": "^3.x",
"react": ">= 16.8.0 < 19.0.0"
},
"scripts": {
"lint": "eslint 'src/**/*'",
Expand Down
1 change: 1 addition & 0 deletions src/routing/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,6 @@ export {
handleLocationChange,
type Routing404Event,
} from "./handleLocationChange";
export { useIsRouteActive } from "./useIsRouteActive";

export { RoutingContext } from "./providers";
4 changes: 3 additions & 1 deletion src/routing/providers.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import { createContext, MutableRefObject, useContext } from "react";

import { RoutingEvent } from "./routingEvent";

type RoutingContext = {
activeRouteEvents?: MutableRefObject<any[]>;
activeRouteEvents?: MutableRefObject<RoutingEvent<any>[]>;
};

export const RoutingContext = createContext<RoutingContext | undefined>(
Expand Down
Loading

0 comments on commit 8f9a4d4

Please sign in to comment.