Guard component helps to prevent a user from losing unsaved data
The component is a ... .
> npm install --save @paprika/guard
or> yarn add @paprika/guard
React <16.8.x
``js
import Guard from "@paprika/guard";
function App() {
function doClose() {}
return (
);
}
`
React >=16.8.x
`js
import Guard from "@paprika/guard";
function MyComponent() {
const canLeave = Guard.useGuard(); // a hook
const isDirty = React.useState(false);
function doClose() {}
return (
function App() {
return (
);
}
`
// TODO
- a11yTextcanPropagate
- children
- (required)hasInsetFocusStyle
- isDisabled
- onClick
- (required)tabIndex
- role`
-