Skip to content

Instantly share code, notes, and snippets.

@tomat
Last active January 5, 2017 08:00
Show Gist options
  • Select an option

  • Save tomat/ee6f7e1a95328f114d79467beb186ba1 to your computer and use it in GitHub Desktop.

Select an option

Save tomat/ee6f7e1a95328f114d79467beb186ba1 to your computer and use it in GitHub Desktop.
import React, { Component } from 'react';
export default class MyTextEditor extends Component {
componentDidMount() {
import('jquery').then((jquery) => {
window.jQuery = jquery;
window.$ = jquery;
import('../lib/redactor/redactor.js').then(() => {
$(this.refs.textarea).redactor();
});
});
}
render() {
return (
<textarea ref="textarea"></textarea>
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment