wangzuo / react-medium-editor

React wrapper for medium-editor
https://wangzuo.github.io/react-medium-editor
MIT License
504 stars 93 forks source link

Remove overhead dependencies #22

Open vansosnin opened 8 years ago

vansosnin commented 8 years ago

Hello! You use babel 6, so it seems like no need to use package object-assign, better use ES6. Also in my opinion there is no need to pull dependency blacklist for 10 lines of code so I just replaced it with helper function.

shark0der commented 8 years ago

Well actually you could use destructuring to get rid of extra props:

render() {
  var { contentEditable, tag, dangerouslySetInnerHTML, ...props } = this.props;

  elementProps = {
      ...props,
      contentEditable: true,
      dangerouslySetInnerHTML: {__html: this.state.text}
  };

  return React.createElement(tag, elementProps);
},
vansosnin commented 8 years ago

Thanks. Should I fix it so my pull request could be merged?