richmd-react
TypeScript icon, indicating that this package has built-in type declarations

0.3.0 • Public • Published

Richmd React

NPM npm NPM

Install

yarn add richmd richmd-react

Usage

It use Richmd component`.

import React, { useState } from 'react';
import { render } from 'react-dom';
import { Richmd } from "richmd-react";
import 'richmd/richmd.css';

const Editor = () => {
  const [text, setMarkdown] = useState('');

  return (
    <>
      <form id="post-form">
        <div id="editor">
          <textarea className="textField" spellCheck="false" onChange={(e) => setMarkdown(e.target.value)}></textarea>
        </div>
        <div id="preview">
          <Richmd className="preview" text={text} />
        </div>
      </form>
    </>
  )
}

render(<Editor />, document.getElementById('root'))

Props

Name Description
text To parse HTML set Markdown text.
id It set id.
className It set ClassName.

License

MIT

Package Sidebar

Install

npm i richmd-react

Weekly Downloads

4

Version

0.3.0

License

MIT

Unpacked Size

7.82 kB

Total Files

24

Last publish

Collaborators

  • nappa