Skip to content

Instantly share code, notes, and snippets.

@indreklasn
Created December 17, 2019 11:34
Show Gist options
  • Save indreklasn/9b4f071a0d46a601bc77f58ef8de041e to your computer and use it in GitHub Desktop.
Save indreklasn/9b4f071a0d46a601bc77f58ef8de041e to your computer and use it in GitHub Desktop.
import React from 'react'
import { Form, Button, Input } from 'antd';
import { createNote } from '../api'
const NoteForm = ({ form, notes, setNotes }) => {
const { getFieldDecorator, validateFields, resetFields } = form;
function handleSubmit(e) {
e.preventDefault();
}
return (
<Form style={{marginBottom: '25px'}} layout="horizontal" onSubmit={handleSubmit}>
<Form.Item>
{getFieldDecorator('note', {
rules: [],
})(
<Input
className="note-input"
size="large"
placeholder="Add New Note"
/>,
<Button>Create</Button>
)}
</Form.Item>
</Form>
)
}
const WrappedNoteForm = Form.create({name: 'notes_form'})(NoteForm)
export default WrappedNoteForm;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment