I tried to get the mention plugin in draft-js get working with Browserify. This is because of the fact that our application is build with Browserify.
It's about this plugin: https://www.draft-js-plugins.com/plugin/mention
In the examples they are using Webpack, and they use imports.
I use require. So an example of my code is:
var React = require('react'),
Draft = require('draft-js'),
Immutable = require('immutable'),
Editor = require('draft-js-plugins-editor'),
Mention = require('draft-js-mention-plugin');
var mentionPlugin = Mention.createMentionPlugin();
var MentionSuggestions = mentionPlugin.MentionSuggestions;
var plugins = [mentionPlugin];
var Editor = React.createClass({
// Code
});
I don't use ES6 notation. Does anybody know what I'm doing wrong?