@braces/react-confirm
v0.10.4
Published
React confirm dialog HOC
Downloads
37
Maintainers
Readme
React Confirm
This package is deprecate, Please check @braces/reconfirm
Install
1 Install react confirm as dependency
# Using yarn package manager
$ yarn add @braces/react-confirm
# Using npm package manager
$ npm install --save @braces/react-confirm
2 Import React confirm module
// ES6
import Confirm from "@braces/react-confirm"
// ES5
var Confirm = require("@braces/react-confirm");
Example
import React from "react";
import confirm from "@braces/react-confirm";
const Component = (props) => {
return (
<div>
<button onClick={props.confirm}>Confirm</button>
{props.confirmed ? "Is confirmed" : "Is not confirmed"}
</div>
);
};
const ConfirmDialog= (props) => {
return (
<div>
Confirm Message...
<button onClick={props.doConfirm}>Confirm</button>
</div>
);
}
export default confirm(ConfirmDialog)(HomePage)
Contributing!
All contributions are super welcome!
License
React Confirm is MIT licensed.