Giter Site home page Giter Site logo

diedsmiling / material-ui-markdown-editor Goto Github PK

View Code? Open in Web Editor NEW
29.0 6.0 9.0 915 KB

React.js Markdown editor component based on material-ui

License: MIT License

HTML 1.08% JavaScript 97.10% CSS 1.82%
material-ui markdown editor-plugin codemirror

material-ui-markdown-editor's People

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

material-ui-markdown-editor's Issues

Cant use MarkdownEditor Component

It looks like this project is using an outdated CodeMirror or React version but I can't get my project to load when I import the MarkdownEditor Component. I get the following error:

TypeError: Cannot read property 'func' of undefined
./node_modules/react-codemirror/lib/Codemirror.js
node_modules/react-codemirror/lib/Codemirror.js:12
9 | var CodeMirror = React.createClass({
10 | displayName: 'CodeMirror',
11 | propTypes: {

12 | onChange: React.PropTypes.func,
13 | onFocusChange: React.PropTypes.func,
14 | options: React.PropTypes.object,
15 | path: React.PropTypes.string,
View compiled

The above error occurred in the <IconMenu> component (Double react ?)

Hello, I'm trying to use the markdown material in an application and every time the component is returned I get the following error, I've tried everything but I can not figure it out the cause.
im ussing a stepper, but, the same error apears when i use without a stepper.

code of Markdown.js

import React from 'react';

import MarkdownEditor from 'material-ui-markdown-editor'

import 'codemirror/lib/codemirror.css' // import codemirror styles 

import 'material-ui-markdown-editor/dist/MarkdownEditor/codemirrorOverride.css' // import override styles 

export const Markdown = () => {
    return(
      <MarkdownEditor
      title="Foo"
      code="# Fancy markdown editor!"
    />
    )
}

invariant.js:42 Uncaught Error: Element ref was specified as a string (iconMenuContainer) but no owner was set. You may have multiple copies of React loaded. (details: https://fb.me/react-refs-must-have-owner). at invariant (invariant.js:42) at coerceRef (react-dom.development.js:6736) at reconcileSingleElement (react-dom.development.js:7532) at reconcileChildFibers (react-dom.development.js:7635) at reconcileChildrenAtExpirationTime (react-dom.development.js:7756) at reconcileChildren (react-dom.development.js:7747) at finishClassComponent (react-dom.development.js:7881) at updateClassComponent (react-dom.development.js:7850) at beginWork (react-dom.development.js:8225) at performUnitOfWork (react-dom.development.js:10224) at workLoop (react-dom.development.js:10288) at HTMLUnknownElement.callCallback (react-dom.development.js:542) at Object.invokeGuardedCallbackDev (react-dom.development.js:581) at invokeGuardedCallback (react-dom.development.js:438) at renderRoot (react-dom.development.js:10366) at performWorkOnRoot (react-dom.development.js:11014) at performWork (react-dom.development.js:10967) at batchedUpdates (react-dom.development.js:11086) at batchedUpdates (react-dom.development.js:2330) at dispatchEvent (react-dom.development.js:3421)

The above error occurred in the <IconMenu> component: in IconMenu in DropDown in div in ToolbarSection in div in ToolbarGroup in div in Toolbar in ToolbarPanel in div in MarkdownEditor (at Markdown.js:7) in Markdown (at Create.js:346) in div (at Create.js:345) in div (created by StepContent) in div (created by ExpandTransitionChild) in div (created by ExpandTransitionChild) in ExpandTransitionChild (created by TransitionGroup) in div (created by TransitionGroup) in TransitionGroup (created by ExpandTransition) in ExpandTransition (created by ExpandTransition) in ExpandTransition (created by StepContent) in div (created by StepContent) in StepContent (at Create.js:344) in div (created by Step) in Step (at Create.js:342) in div (created by Stepper) in Stepper (at Create.js:277) in div (at Create.js:272) in div (created by CardText) in CardText (at Create.js:267) in div (created by Card) in div (created by Paper) in Paper (created by Card) in Card (at Create.js:262) in Create (created by Route) in Route (created by PrivateRoute) in PrivateRoute (at App.js:66) in div (at App.js:63) in div (at App.js:61) in Router (created by BrowserRouter) in BrowserRouter (at App.js:60) in div (at App.js:59) in MuiThemeProvider (at App.js:58) in div (at App.js:57) in App (at index.js:7)

TypeError: Cannot read property 'prepareStyles' of undefined

Toolbar.render
node_modules/material-ui-markdown-editor/node_modules/material-ui/Toolbar/Toolbar.js:82
  79 |     noGutter = _props.noGutter,
  80 |     style = _props.style,
  81 |     other = (0, _objectWithoutProperties3.default)(_props, ['children', 'className', 'noGutter', 'style']);
> 82 | var prepareStyles = this.context.muiTheme.prepareStyles;
  83 | 
  84 | var styles = getStyles(this.props, this.context);
  85 | 

Highlight selected heading in dropdown

When cursor is at Heading, selected heading should be highlighted in the dropdown, not just the dropdown trigger. It will be easier to understand, that selecting item from dropdown list will cancel the heading formatting.

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.