CoursesPage update
parent
d09fa93d90
commit
c4394dd747
|
@ -1,8 +1,30 @@
|
||||||
import React from "react";
|
import React from "react";
|
||||||
|
|
||||||
class CoursesPage extends React.Component {
|
class CoursesPage extends React.Component {
|
||||||
|
state = {
|
||||||
|
course: {
|
||||||
|
title: ""
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
handleChange = (event) => {
|
||||||
|
const course = { ...this.state.course, title: event.target.value };
|
||||||
|
this.setState({ course });
|
||||||
|
};
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
return <h2>Courses</h2>;
|
return (
|
||||||
|
<form>
|
||||||
|
<h2>Courses</h2>
|
||||||
|
<h3>Add Course</h3>
|
||||||
|
<input
|
||||||
|
type="text"
|
||||||
|
onChange={this.handleChange}
|
||||||
|
value={this.state.course.title}
|
||||||
|
/>
|
||||||
|
<input type="submit" value="Save" />
|
||||||
|
</form>
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue