xpioneer / react-contenteditable

A Simple ContentEditable Component with React

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

React-ContentEditable

A simple editable plugin with react, can fire keywords(props key: delimiter, default: #)

Installation

yarn add react-editable-tag

#or

npm i react-editable-tag

Usage

import React, { useState } from 'react'
import { ContentEditable } from '../src/index'

function App() {
  const [keyWords, setKeyWords] = useState<string>()

  const onKeyWord = () => {
    const val = prompt('Please input')
    if(val !== null) {
      setKeyWords(val)
    }
  }


  return <div>
    <ContentEditable
      keyWords={keyWords}
      onKeyWord={onKeyWord}/>
  </div>
}

Features

  • React Hooks
  • TypeScript
  • Antd Style

About

A Simple ContentEditable Component with React


Languages

Language:TypeScript 64.4%Language:JavaScript 23.6%Language:Less 9.1%Language:HTML 2.9%