Skip to content
This repository has been archived by the owner on Aug 31, 2021. It is now read-only.

IMPERIAL's react-ace-editor Fork for custom solutions (DEPRECATED)

Notifications You must be signed in to change notification settings

imperialbin/imperial-ace-editor

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

REACT-ACE-EDITOR

Introduction

This is a react wrapper around the Ace Editor Ace Editor Demo Ace Editor Github

Getting Started

npm install --save react-ace-editor

Usage

import ReactAce from 'react-ace-editor';
import React, { Component } from 'react';

class CodeEditor extends Component {
  constructor() {
    super();
    this.onChange = this.onChange.bind(this);
  }
  onChange(newValue, e) {
    console.log(newValue, e);

    const editor = this.ace.editor; // The editor object is from Ace's API
    console.log(editor.getValue()); // Outputs the value of the editor
  }
  render() {
    return (
      <ReactAce
        mode="javascript"
        theme="eclipse"
        setReadOnly=false
        onChange={this.onChange}
        style={{ height: '400px' }}
        ref={instance => { this.ace = instance; }} // Let's put things into scope
      />
    );
  }
}

More Documentation

For all the available method from the Ace Editor, please checkout Ace Editor's API documentation

About

IMPERIAL's react-ace-editor Fork for custom solutions (DEPRECATED)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%