Use this gist to write down notes and questions as you read through the lesson plan. https://github.com/turingschool/lesson_plans/blob/master/ruby_04-apis_and_scalability/react_in_theory.markdown
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//-------------------------------Main (parent) component | |
var Main = React.createClass({ | |
// props: name (data) | |
// state: counter (data) | |
getInitialState: function() { | |
return { counter: 0 }; | |
}, | |
handleClick: function() { | |
this.setState({ counter: ++this.state.counter }); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Write a recursive function that outputs the range between two positive numbers | |
// myFunction(1, 5) #=> [1, 2, 3, 4, 5] | |
// (5 pts) | |
// Write a recursive function that outputs the sum of an array of integers | |
// myFunction([1, 2, 3, 4, 5, 6]) #=> 21 | |
// (5 pts) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
///// index.js | |
import React from 'react'; | |
import ReactDOM from 'react-dom'; | |
import HelloWorld from './HelloWorld'; | |
ReactDOM.render(<HelloWorld name='Meeka' />, document.getElementById('container')); | |
///// HelloWorld.js |
- Recursion
- Generators
- Exercises
- https://github.com/mdn/advanced-js-fundamentals-ck/blob/gh-pages/tutorials/02-functions/04-recursion.md#countdown
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// Older | |
///////////// Here, we specify the defaultProps and the initialState in functions in the component | |
///////////// We also validate the component props in the propTypes function | |
var Counter = React.createClass({ | |
getDefaultProps: function(){ | |
return {initialCount: 0}; | |
}, | |
getInitialState: function() { | |
return {count: this.props.initialCount} |
- Linked lists
- BST in JavaScript or Ruby
- Dangerous Denver
- Performance dojo
- Scaled Down Scaled Up
- https://github.com/turingschool/lesson_plans/blob/master/ruby_04-apis_and_scalability/scaled_down_scale_up.markdown