0.0.1 • Published 3 years ago

@ltipton/react-ace-editor v0.0.1

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years ago

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

0.0.1

3 years ago