summernote / react-summernote

Summernote (Super simple WYSIWYG editor) adaptation for react
http://summernote.org
MIT License
230 stars 108 forks source link

Using UNSAFE_componentWillReceiveProps #89

Open duypham90 opened 4 years ago

duypham90 commented 4 years ago

Hello @olezhek85, I see the old PR before that of you: https://github.com/summernote/react-summernote/pull/83/files

I have some issue in console log when use this library I attached the file and the way I used it below, Please help me take a look it. Thanks

image

import React from 'react';
import './globals';
import ReactSummernote from 'react-summernote';
import 'react-summernote/dist/react-summernote.css';
import 'react-summernote/lang/summernote-vi-VN';
import '~/../bootstrap/js/dist/modal';
import '~/../bootstrap/js/dist/dropdown';
import '~/../bootstrap/js/dist/tooltip';

export default function Form() {

  function onChange(content: any) {
    console.log('onChange', content);
  }

  return (
    <div className="container">
      <ReactSummernote
        value="Default value"
        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={onChange}
      />
    </div>
  );
}

Here is the package.json

{
  "name": "trendsvn",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "bootstrap": "^4.5.0",
    "jquery": "^3.5.1",
    "node-sass": "^4.14.1",
    "popper.js": "^1.16.1",
    "react": "^16.13.1",
    "react-dom": "^16.13.1",
    "react-google-login": "^5.1.21",
    "react-router-dom": "^5.2.0",
    "react-scripts": "3.4.1",
    "react-summernote": "^2.0.2",
    "typescript": "~3.7.2"
  },
  "scripts": {
    "start": "set HTTPS=true&&react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test",
    "eject": "react-scripts eject"
  },
  "eslintConfig": {
    "extends": "react-app"
  },
  "browserslist": {
    "production": [
      ">0.2%",
      "not dead",
      "not op_mini all"
    ],
    "development": [
      "last 1 chrome version",
      "last 1 firefox version",
      "last 1 safari version"
    ]
  },
  "devDependencies": {
    "@testing-library/jest-dom": "^4.2.4",
    "@testing-library/react": "^9.3.2",
    "@testing-library/user-event": "^7.1.2",
    "@types/jest": "^24.0.0",
    "@types/node": "^12.0.0",
    "@types/react": "^16.9.43",
    "@types/react-dom": "^16.9.0",
    "@types/react-router-dom": "^5.1.5",
    "@types/jquery": "^3.5.1"
  }
}