This repository was archived by the owner on May 31, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +6
-22
lines changed Expand file tree Collapse file tree 2 files changed +6
-22
lines changed Original file line number Diff line number Diff line change 55 "private" : true ,
66 "license" : " MIT" ,
77 "dependencies" : {
8- "@djsp/counter " : " latest" ,
8+ "@djsp/utils " : " latest" ,
99 "@djsp/editor" : " latest" ,
1010 "react" : " ^16.2.0" ,
1111 "react-dom" : " ^16.2.0" ,
Original file line number Diff line number Diff line change @@ -3,17 +3,13 @@ import ReactDOM from 'react-dom'
33
44import { EditorState , ContentState } from 'draft-js'
55import { EditorContainer , Editor } from '@djsp/editor'
6- import Counter , {
7- getCharCount ,
8- getWordCount ,
9- getLineCount ,
10- } from '@djsp/counter'
6+ import { getCharCount , getWordCount , getLineCount } from '@djsp/utils'
117import './styles.css'
128
139class App extends Component {
1410 state = {
1511 editorState : EditorState . createWithContent (
16- ContentState . createFromText ( 'Have a nice day !' )
12+ ContentState . createFromText ( 'Just type !' )
1713 ) ,
1814 }
1915
@@ -25,21 +21,9 @@ class App extends Component {
2521 < EditorContainer
2622 editorState = { this . state . editorState }
2723 onChange = { this . onChange } >
28- < Counter >
29- { editorState => (
30- < span > Char count: { getCharCount ( editorState ) } </ span >
31- ) }
32- </ Counter >
33- < Counter >
34- { editorState => (
35- < span > Word count: { getWordCount ( editorState ) } </ span >
36- ) }
37- </ Counter >
38- < Counter >
39- { editorState => (
40- < span > Line count: { getLineCount ( editorState ) } </ span >
41- ) }
42- </ Counter >
24+ < div > Char count: { getCharCount ( this . state . editorState ) } </ div >
25+ < div > Word count: { getWordCount ( this . state . editorState ) } </ div >
26+ < div > Line count: { getLineCount ( this . state . editorState ) } </ div >
4327 < Editor />
4428 </ EditorContainer >
4529 </ div >
You can’t perform that action at this time.
0 commit comments