Coder Social home page Coder Social logo

react-code-mirror's Introduction

react-code-mirror

Deprecated. Use https://github.com/scniro/react-codemirror2

Installation

npm install react-code-mirror

If you're not using browserify/node you can also just load the standalone.js file (having first loaded CodeMirror and React.

Usage

See example folder

It can also render server side, providing you don't require('codemirror') anywhere on the server. If you render server side it will just render the mobile view (i.e. a textarea) that will get upgraded to the full CodeMirror editor on the client.

License

MIT

react-code-mirror's People

Contributors

ericlathrop avatar forbeslindesay avatar kyleamathews avatar stayradiated avatar stopachka avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

react-code-mirror's Issues

Return change object with onChange

At present, the react-code-mirror component only gives the new content of the document to onChange handlers (presumably for consistency with React's textarea implementation). However, CodeMirror's internal change event fires with additional, useful information:

The changeObj is a {from, to, text, removed, origin} object containing information about the changes that occurred as second argument.

It would be great if the React component also provided this information to onChange handlers.

Update React dependency

Your package triggers an installation error when used with React 0.13.x

Could you please update peerDependencies react to ">=0.12.0"?

Thanks

Codemirror 5.0

This package looks not working on codemirror 5.0(peerDependencies)

Would I able to use it?

Requiring the CodeMirror Mode

In the example you show requireing the mode in your index.js, before React gets its hands on the CodeMirror component. For my case, I need to be able to set the mode dynamically. The way I'm doing this for the component that has a CodeMirror instance is to require the mode in componentWillMount. This works for me, especially since I have multiple CodeMirror instances on the page, though I'm wondering if maybe there's a better approach.

developing config api

Hello All,

We are going to be making heavy use of react-code-mirror over at freecodecamp.com/https://github.com/FreeCodeCamp/freecodecamp and would love to help move this project.

One thing that is missing is setting config options, such as setSize, setOption and setting operations on events.

I am opening up this issue to see if we can get some dialog about possible api options. I will be hacking up some options for us at freecodecamp so we can start using them immediately.

One possible idea would be for a separate config prop that takes an object and with properties such as `{setSize: [] } and then loop over the properties and calling them over the editor object. This is a simplistic way of doing things and will need some work still.

Let me know what yall think

cc @QuincyLarson @terakilobyte

Support React 0.14.0

The peer dependencies don't support the new React 0.14.0 release:

  "peerDependencies": {
    "codemirror": ">=4.6.0 <6.0.0",
    "react": ">=0.12.0 <0.14.0"
  },

What needs to be done to support 0.14.0, and how can I help?

vim keymapping?

How would I go about adding Vim (or other) keymapping? Right now it just throws an error.

Not rendering the component

When I try to run the project I only see the text {{component}} in the browser. All other react projects are running as expected. My editor indicates that there redundant character escapes in build.js and that standalone.js has a unresolved textAreaClass and the local CodeMirrorEditor var is redundant. I'm on OS X and running the chrome browser. Let me know what else I can do to run your fine project.

peerDependency issue with react 15.3.1

currently react 15.3.1 is not supported by react-code-mirror.

On testing, all seems to work with 15.3.1 -- should we bump the peerDependency in package.json?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.