October 2019
Intermediate to advanced
426 pages
11h 49m
English
Next, we are going to define the AddTodo component, which renders an input field and a button.
Let's implement the AddTodo component now:
import React from 'react'export default class AddTodo extends React.Component { render () { return (
<form> <input type="text" placeholder="enter new task..." style={{ width: 350, height: 15 }} /> <input type="submit" style={{ float: 'right', marginTop: 2 }} value="add" /> </form> ) }}
As we can see, the AddTodo component consists of an input field and a button.
Read now
Unlock full access