Skip to content

Commit af46663

Browse files
author
Kent C. Dodds
committed
fix 02-state in tdd
1 parent 128c45e commit af46663

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/post-editor-02-state.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
import React from 'react'
22

33
class Editor extends React.Component {
4-
state = {isSaving: true}
4+
state = {isSaving: false}
5+
handleSubmit = e => {
6+
e.preventDefault()
7+
this.setState({isSaving: true})
8+
}
59
render() {
610
return (
7-
<form>
11+
<form onSubmit={this.handleSubmit}>
812
<label htmlFor="title-input">Title</label>
913
<input id="title-input" />
1014

0 commit comments

Comments
 (0)