Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

react antd modal with quill

// Post.tsx
import { Button, Form, Input, Typography } from 'antd';
import TextEditor from 'components/TextEditor';
import React, { useState } from 'react';

const { Item } = Form;
const { TextArea } = Input;
const { Title } = Typography;

interface IPostCreate {
  body: string;
}

export const PostCreate = () => {
  const [form] = Form.useForm();

  const onSubmit = (values: IPostCreate) => {
    // logic to submit form to server
    console.log(values.body);
    form.resetFields();
  };
  return (
    <>
      <Title level={5}>Your Post</Title>

      <Form layout="vertical" form={form} onFinish={onSubmit}>
        <Item
          name="body"
          rules={[
            {
              required: true,
              message: 'Please enter body of post',
            },
          ]}
        >
          {/* @ts-ignore */}
          <TextEditor />
        </Item>

        <Item>
          <Button htmlType="submit" type="primary">
            Submit
          </Button>
        </Item>
      </Form>
    </>
  );
};
Comment

PREVIOUS NEXT
Code Example
Javascript :: javascript complier 
Javascript :: communicate between content script and bg 
Javascript :: javascript palindrome check 
Javascript :: lowercase vs lower locale 
Javascript :: Calculator for two numbers 
Javascript :: Declaring A Method Outside The Constructor 
Javascript :: Error: Invalid route module file 
Javascript :: Toggle child element onclick of parent element 
Javascript :: square brackets javascript object key 
Javascript :: Looping through array, fetching tweets and returning new reversed array javascript react 
Javascript :: JavaScript HTMLCollection Object 
Javascript :: check token balance of an address using web3 
Javascript :: Exporting Objects with the Exports Object in electron 
Javascript :: button style when clicked and unclicked react material 
Javascript :: useEffect : react to manipulate the DOM 
Javascript :: how to render react quill the way it is without the html tags 
Javascript :: merge large arrays 
Javascript :: Backbone View In Another View 
Javascript :: 2d array js 
Javascript :: react tutorial app 
Javascript :: get class name of object javascript 
Javascript :: what is callback hell in javascript 
Javascript :: loop js 
Javascript :: sort include sequelize 
Javascript :: vs code ouput stack 
Javascript :: knockout subscribe 
Javascript :: javascript declare variables 
Javascript :: javascript Symbol Properties 
Javascript :: javascript Undeclared objects are not allowed 
Javascript :: httpclient post raw json body 
ADD CONTENT
Topic
Content
Source link
Name
6+1 =