Comparing version 17.11.0 to 17.12.0
# CHANGELOG | ||
## 17.12.0 | ||
`useCanDeactivate` new hook with limitation only one per component. | ||
## 17.11.0 | ||
`key` and `ref` are deleted from props in TSX. | ||
`key` and `ref` are deleted from props in TSX. | ||
@@ -7,0 +11,0 @@ ## 17.10.0 |
{ | ||
"name": "bobril", | ||
"version": "17.11.0", | ||
"version": "17.12.0", | ||
"description": "Component Oriented MVC Framework with virtual DOM and CSS", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
import { | ||
Component, | ||
IBobrilCtx, | ||
@@ -14,2 +15,3 @@ IBobrilComponent, | ||
IDataWithChildren, | ||
getCurrentCtx, | ||
getDomNode, | ||
@@ -832,1 +834,11 @@ } from "./core"; | ||
} | ||
export function useCanDeactivate(handler: NonNullable<Component["canDeactivate"]>): void { | ||
const ctx = getCurrentCtx(); | ||
if (ctx) { | ||
ctx.me.component.canDeactivate = function (ctx: IBobrilCtx, transition: IRouteTransition): IRouteCanResult { | ||
return handler.call(ctx, transition); | ||
}; | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
394529
9434