@ltipton/react-ace-editor

0.0.1 • Public • Published

Ace Editor in React

Getting Started

yarn add https://github.com/lancetipton/react-ace-editor.git

Usage

import ReactAce from 'react-ace-editor'
import React, { useRef, useCallback } from 'react'

export const Editor = props => {
  const aceRef = useRef(null)

  const onChange = useCallback(updatedText => {
    // ...do something with the text or the ref (aceRef)
  })
  
  return (
    <ReactAce
      mode="javascript"
      theme="monokai"
      readOnly=false
      value={props.value}
      onChange={onChange}
      style={{ height: `400px`, width: `100vw` }}
      ref={element => { aceRef.current = element }}
    />
  )
}

More Documentation

Readme

Keywords

Package Sidebar

Install

npm i @ltipton/react-ace-editor

Weekly Downloads

3

Version

0.0.1

License

ISC

Unpacked Size

9.52 kB

Total Files

5

Last publish

Collaborators

  • lktipton