# @amrn/react-simplemde

> Produce universal library with webpack and es6

Latest version **1.0.0** (published 2018-01-12) · MIT license · 0 weekly downloads

## Install

```sh
npm install @amrn/react-simplemde
pnpm add @amrn/react-simplemde
yarn add @amrn/react-simplemde
bun add @amrn/react-simplemde
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2018-01-12 |
| First published | 2018-01-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1344 |
| Author | Krasimir Tsonev |
| Maintainers | amrn |
| Keywords | webpack, es6, starter, library, universal, umd, commonjs |

## Links

- npm: https://www.npmjs.com/package/@amrn/react-simplemde
- Repository: https://github.com/krasimir/webpack-library-starter
- Issues: https://github.com/krasimir/webpack-library-starter/issues
- npm.io page: https://npm.io/package/@amrn/react-simplemde

## Dependencies (1)

- [@amrn/simplemde](https://npm.io/package/@amrn/simplemde.md) ^1.11.3

## Alternatives

- [@mdxeditor/editor](https://npm.io/package/@mdxeditor/editor.md) — 962.4K weekly downloads
- [mmdb-lib](https://npm.io/package/mmdb-lib.md) — 680.9K weekly downloads
- [playcanvas](https://npm.io/package/playcanvas.md) — 36.2K weekly downloads
- [@glw907/cairn-cms](https://npm.io/package/@glw907/cairn-cms.md) — 967 weekly downloads
- [markdown-to-confluence](https://npm.io/package/markdown-to-confluence.md) — 103 weekly downloads

## Recent versions

- 1.0.0 (latest) — 2018-01-12

## README

# React SimpleMDE Markdown Editor
[![NPM version][npm-badge]][npm]

React component wrapper for
[SimpleMDE](https://github.com/NextStepWebs/simplemde-markdown-editor).

> Based on [react-simplemde-editor](https://github.com/RIP21/react-simplemde-editor)
> This one uses my [custom](https://github.com/AmrN/simplemde-markdown-editor) Simplemde Editor

Only two dependencies, React and SimpleMDE.

## Install
```
npm install --save react-simplemde
```

## Demo
http://www.benrlodge.com/projects/react-simplemde

or view it locally:
```
git clone https://github.com/amrn/react-simplemde.git
cd react-simplemde
npm install && npm run dev
cd example
npm install && npm start
```

## Usage
View the [demo code](https://github.com/amrn/react-simplemde/tree/master/example) for a full example.

Not required, but useless without it, the `onChange` callback is the only option you need to set.

```javascript
import React from 'react'
import SimpleMDE from '@amrn/react-simplemde'

<SimpleMDE
  onChange={this.handleChange}
/>
```

## Options
Set additional [SimpleMDE options](https://github.com/NextStepWebs/simplemde-markdown-editor#configuration) with an options prop.

Note - while SimpleMDE options has an `initialValue` option, this component only takes a `value` prop which is set as the `initialValue` on first render.

```javascript
import React from 'react'
import SimpleMDE from '@amrn/react-simplemde'

<SimpleMDE
  onChange={this.handleChange}
  value={this.state.textValue}
  options={{
    autofocus: true,
    spellChecker: false,
    // etc.
  }}
/>
```

You can include key maps using the `extraKeys` prop.
Read more at https://codemirror.net/doc/manual.html#option_extraKeys

```javascript
extraKeys = {
  Up: function(cm) {
    cm.replaceSelection(" surprise. ");
  },
  Down: function(cm) {
    cm.replaceSelection(" surprise again! ");
  }
};

<SimpleMDE
  onChange={this.handleChange}
  extraKeys={extraKeys}
/>
```

[npm-badge]: http://badge.fury.io/js/react-simplemde.svg
[npm]: http://badge.fury.io/js/react-simplemde

---
_Source: https://npm.io/package/@amrn/react-simplemde · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
