Skip to content

Commit ba0f611

Browse files
committed
Adding comments for future possible refactoring
1 parent 487950c commit ba0f611

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

client/components/CodeEditor.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ class CodeEditor extends Component {
2222
}
2323
}
2424

25-
//receiving code input as a prop from singleProblem once that is done loading from the db api call
25+
// Receiving code input as a prop from singleProblem once that is done loading from the db api call
26+
// This has worked 100% of the time
2627
componentWillReceiveProps(nextprop){
2728
if(nextprop.userInput && nextprop.userInput.length){
2829
this.setState({code: nextprop.userInput})
@@ -37,6 +38,7 @@ class CodeEditor extends Component {
3738

3839
render() {
3940
const { problemId, userId, handleSave, userInput } = this.props;
41+
console.log('state', this.state)
4042
return (
4143
<div>
4244
<div>

client/components/SingleProblem.js

+1
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ class SingleProblem extends Component {
5252
*/
5353
const mapState = (state, ownprops) => {
5454
return {
55+
// Params: to refactor to not use ownprops.match.params.id. Idea: put an onClick function in the Levels component to dispatch to the store
5556
params: parseInt(ownprops.match.params.id),
5657
problem: state.currentProblem,
5758
isLoggedIn: !!state.user.id,

0 commit comments

Comments
 (0)