react-summernote
react-summernote copied to clipboard
Usage with create React app
Hi, Im using this editor with create react app and I dont want to eject my app to modify the webpack config.
I have added bootstrap and jquery package.
yarn add [email protected] bootstrap
So I manually imported $ and jquery as follows and modified your example as follows.
But this causes Uncaught TypeError: $node.attr(...).tooltip is not a function.
`import React, { Component } from 'react'; import $ from 'jquery'; const jQuery = $; import ReactSummernote from 'react-summernote'; import 'react-summernote/dist/react-summernote.css'; // import styles // import 'react-summernote/lang/summernote-ru-RU'; // you can import any other locale
// Import bootstrap(v3 or v4) dependencies import 'bootstrap/js/modal.js'; import 'bootstrap/js/dropdown.js'; import 'bootstrap/js/tooltip.js'; import 'bootstrap/dist/css/bootstrap.css';
class RichTextEditor extends Component { onChange(content) { console.log('onChange', content); }
render() { return ( <ReactSummernote value="Default value HTML" options={{ lang: 'ru-RU', height: 350, dialogsInBody: true, toolbar: [ ['style', ['style']], ['font', ['bold', 'underline', 'clear']], ['fontname', ['fontname']], ['para', ['ul', 'ol', 'paragraph']], ['table', ['table']], ['insert', ['link', 'picture', 'video']], ['view', ['fullscreen', 'codeview']] ] }} onChange={this.onChange} /> ); } }
export default RichTextEditor;`
You may want to take a look at issue #22 . The workaround specified there might help in your problem. 😄
fdgdfgdfgdfgfdg
### dgdsgsdfgdsdsfs