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
///// 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 |
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
//-------------------------------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 }); |
1507
- Sinon and Stuff
JavaScript Events (with Meeka)
Homework:
- watch: https://vimeo.com/105955605
- fork and reply: https://gist.github.com/stevekinney/353182d7cd10fb4a5b27
Unit testing JS (with Meeka):
Monday December 7, 2015
1507
Morning challenge
- It starts out with five buttons.
- When you click the first button, it alerts the us that "Button #1" has been clicked.
- The equivalent works for the second, third, fourth, and fifth buttons.
- There is an additional button for adding new buttons.
- When added and subsequently clicked, the sixth button will log that "Button #6" was clicked.
2 December 2015
1507
Countdown
Functions in JavaScript