react-wysiwyg-typescript
A wrapper Component for react-draft-wysiwyg written in Typescript
This package require a css file, make sure you use webpack or similar tools for handler this file type.
Table of Contents
Install
npm i react-wysiwyg-typescript -S # or yarn add react-wysiwyg-typescript
Usage
state = Draft editorState= onEditorStateChange=/ // save html to server // convert raw to draft // convert draft to raw // convert rawToDraft file to HTML
If you use antd's Form Component and you are ready to go.
<FormItem label="Contents" ...alignProps wrapperCol= span: 16 > <Draft editorState=thisstateeditorState onEditorStateChange= { this } /> </FormItem> // convert state to html thispropsform
Contribute
Small note: If editing the README, please conform to the standard-readme specification.
License
MIT © sumn2u