File tree Expand file tree Collapse file tree 4 files changed +11
-15
lines changed
Expand file tree Collapse file tree 4 files changed +11
-15
lines changed Original file line number Diff line number Diff line change 44 "rules": {
55 "indent": [2, 4, {"SwitchCase": 1}],
66 "max-len": [2, 140, 2],
7-
8- "react/jsx-indent-props": [2, 4],
9- "react/prefer-stateless-function": 0
7+ "react/jsx-indent-props": [2, 4]
108 }
119}
Original file line number Diff line number Diff line change 77 " dist"
88 ],
99 "scripts" : {
10+ "clean" : " rimraf dist" ,
1011 "start" : " webpack-dev-server" ,
11- "clean-build" : " rimraf dist" ,
12- "build" : " npm run clean-build && babel src --out-dir dist" ,
12+ "build" : " npm run clean && babel src --out-dir dist" ,
1313 "build-pages" : " npm run clean-build && NODE_ENV=production webpack --config ./webpack.production.config.js --progress --profile --colors" ,
1414 "lint" : " eslint --ignore-path .gitignore ." ,
1515 "test" : " npm run lint" ,
1616 "prepublish" : " npm run build && npm test" ,
17- "prepublish-pages" : " npm run build-pages" ,
17+ "prepublish-pages" : " npm run build-pages && npm test " ,
1818 "publish-pages" : " gh-pages -d dist"
1919 },
2020 "repository" : {
4141 "babel-preset-react" : " ^6.5.0" ,
4242 "copy-webpack-plugin" : " ^1.1.1" ,
4343 "css-loader" : " ^0.23.1" ,
44- "eslint" : " ^2.5.3 " ,
44+ "eslint" : " ^2.6.0 " ,
4545 "eslint-config-airbnb" : " ^6.2.0" ,
4646 "eslint-plugin-react" : " ^4.2.3" ,
4747 "gh-pages" : " ^0.11.0" ,
Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ class App extends React.Component {
2727 < div >
2828 < h2 > Markdown Editor</ h2 >
2929
30- < Textarea value = { this . state . markdown } onChange = { this . onChange } />
30+ < Textarea value = { this . state . markdown } onChange = { this . updateMarkdown } />
3131 </ div >
3232
3333 < div >
Original file line number Diff line number Diff line change 11import React from 'react' ;
22import marked from 'marked' ;
33
4- class MarkdownRenderer extends React . Component {
5- render ( ) {
6- const html = marked ( this . props . markdown || '' , { sanitize : true } ) ;
4+ function MarkdownRenderer ( props ) {
5+ const html = marked ( props . markdown || '' , { sanitize : true } ) ;
76
8- return (
9- < div className = { this . props . className } dangerouslySetInnerHTML = { { __html : html } } > </ div >
10- ) ;
11- }
7+ return (
8+ < div className = { props . className } dangerouslySetInnerHTML = { { __html : html } } > </ div >
9+ ) ;
1210}
1311
1412MarkdownRenderer . propTypes = {
You can’t perform that action at this time.
0 commit comments