diff --git a/package.json b/package.json index d5938da..f5a8c40 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "questions-queue", "version": "0.0.1", - "description": "This is our greenfield project for out greenfield project at hackreactor", + "description": "A web application for students to submit questions to be answered during a later lecture.", "main": "src/server/server.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1", @@ -36,7 +36,6 @@ "mongoose": "^4.9.6", "morgan": "^1.8.1", "passport": "^0.3.2", - "passport-github": "^1.1.0", "passport-github2": "^0.1.10", "path": "^0.12.7", "react": "^15.5.4", diff --git a/src/client/app/CodeZone.jsx b/src/client/app/CodeZone.jsx index 537f7e7..dd86ecf 100644 --- a/src/client/app/CodeZone.jsx +++ b/src/client/app/CodeZone.jsx @@ -22,30 +22,25 @@ class CodeZone extends React.Component { } componentDidMount() { - if (!this.state.codeEditor) { - this.state.codeEditor = CodeMirror.fromTextArea(this.refs.codeZone, { - lineNumbers: true, - mode: 'javascript', - viewportMargin: 50, - readOnly: this.state.readOnly, - // matchBrackets: true, - }); - this.state.codeEditor.on('change', this.handleCodeChange); - } + // initialize CodeMirror + this.state.codeEditor = CodeMirror.fromTextArea(this.refs.codeZone, { + lineNumbers: true, + mode: 'javascript', + viewportMargin: 50, + readOnly: this.state.readOnly, + // matchBrackets: true, + }); + this.state.codeEditor.on('change', this.handleCodeChange); } componentWillUnmount() { + // end CodeMirror instance so element can unmount this.state.codeEditor.toTextArea(); } render() { return ( - +