1

Hello I am trying to implement react markdown editor and I have used Jed Watson's http://jedwatson.github.io/react-md-editor/

But the problem is that, I am getting the error attached. Any thoughts what I am missing :(.. Has anyone encountered similar issue ?enter image description here

import Editor from 'react-md-editor';

state = {
              code: '# React Markdown '            

}

updateCode = (newCode) => {
      this.setState({
          code: newCode
      });
    }

Render:

<Editor value={this.state.code} onChange={this.updateCode} />
1
  • 1
    The editor doesn't appear to be compatible with the version of React being used. It's expecting PropTypes to be part of React, but they were moved into their own package – prop-types. Commented May 28, 2018 at 8:18

1 Answer 1

1

That's because of PropTypes are deprecated since React 15.5.0, and the editor PropTypes usage is incompatible with the editor's React version.

After 15.5.0, they are moved to their own package, and we should use them as follows:

// After (15.5)
import React from 'react';
import PropTypes from 'prop-types';

The repo / package you're using looks abandoned, but there's already submitted PR, that you can use: https://github.com/JedWatson/react-md-editor/pull/17

However, it's on your own to choose - should you fork the repo or use another React Markdown project.

Here are some alternatives:

Sign up to request clarification or add additional context in comments.

1 Comment

@johnsam you're welcome! Please accept the answer, if it helped you. :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.