aboutsummaryrefslogtreecommitdiff
path: root/src/ReplyForm.js
diff options
context:
space:
mode:
authorLibravatar Renard 2019-09-16 16:42:33 -0300
committerLibravatar Renard 2019-09-16 16:42:33 -0300
commit29d9f5ecad2261ed4e4f7712750cf2a126392d8e (patch)
treec09ba0d028b64ff99096d5e66425099107a694c2 /src/ReplyForm.js
parent1b4db364d46d72f7ef7fa14d3291e087327854ff (diff)
downloadbai-client-29d9f5ecad2261ed4e4f7712750cf2a126392d8e.tar.gz
bai-client-29d9f5ecad2261ed4e4f7712750cf2a126392d8e.tar.xz
bai-client-29d9f5ecad2261ed4e4f7712750cf2a126392d8e.zip
Fix: replyForm, setState es async!
Diffstat (limited to 'src/ReplyForm.js')
-rw-r--r--src/ReplyForm.js11
1 files changed, 2 insertions, 9 deletions
diff --git a/src/ReplyForm.js b/src/ReplyForm.js
index 6695406..70e5d49 100644
--- a/src/ReplyForm.js
+++ b/src/ReplyForm.js
@@ -24,14 +24,7 @@ class ReplyForm extends Component {
}
handleSubmit() {
- const {
- submittedName,
- submittedEmail,
- submittedMessage,
- name,
- email,
- message
- } = this.state;
+ const { name, email, message } = this.state;
this.setState(
{
submittedName: name,
@@ -39,6 +32,7 @@ class ReplyForm extends Component {
submittedMessage: message
},
() => {
+ const { submittedName, submittedEmail, submittedMessage } = this.state;
const data = {
board: this.props.dir,
parent: this.props.parent,
@@ -65,7 +59,6 @@ class ReplyForm extends Component {
return response.json();
})
.then(resource => {
- console.log(resource);
this.setState({ replyRes: resource });
});
}