doc & fix: add setDisabled and setError to handleChange method and fix handleError to setError
This commit is contained in:
1 parent
5ac0d48ec7
commit
475d51c2a1
1 file changed
+5
-2
@@ -10,11 +10,14 @@ function Payment() {
|
|||||||
const stripe = useStripe();
|
const stripe = useStripe();
|
||||||
const elements = useElements();
|
const elements = useElements();
|
||||||
|
|
||||||
const [error, handleError] = useState(null);
|
const [error, setError] = useState(null);
|
||||||
const [disabled, setDisabled] = useState(true);
|
const [disabled, setDisabled] = useState(true);
|
||||||
|
|
||||||
const handleSubmit = (e) => {};
|
const handleSubmit = (e) => {};
|
||||||
const handleChange = (e) => {};
|
const handleChange = (e) => {
|
||||||
|
setDisabled(e.empty);
|
||||||
|
setError(e.error ? e.error.message : "");
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<section className="payment">
|
<section className="payment">
|
||||||
|
|||||||
Reference in new issue
Block a user