react-summernote icon indicating copy to clipboard operation
react-summernote copied to clipboard

Usage with create React app

Open khpatel4991 opened this issue 8 years ago • 3 comments

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;`

khpatel4991 avatar Jun 10 '17 17:06 khpatel4991

You may want to take a look at issue #22 . The workaround specified there might help in your problem. 😄

sdabrutas avatar Jun 20 '17 10:06 sdabrutas

fdgdfgdfgdfgfdg

jishanahammed avatar Dec 13 '21 06:12 jishanahammed

### dgdsgsdfgdsdsfs

jishanahammed avatar Dec 13 '21 06:12 jishanahammed