This file contains hidden or 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
| import { types } from './actions'; | |
| const initialState = { | |
| todos: ['Plan web app', 'Analyze use of app', 'Design and develop app', 'Test app', 'Implement and maintain app'] | |
| }; | |
| export const reducer = (state = initialState, action) => { | |
| const { todos } = state; | |
| const { type, payload } = action; |
This file contains hidden or 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
| import React, { Component } from 'react'; | |
| import { connect } from 'react-redux'; | |
| import { actionCreators } from './actions'; | |
| import Input from './Input'; | |
| import List from './List'; | |
| class App extends Component { | |
| constructor(props) { | |
| super(props); | |
| this.state = {}; |
This file contains hidden or 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
| import React, { Component } from 'react'; | |
| export default class List extends Component { | |
| renderItem(text, i) { | |
| const { onClickItem } = this.props; | |
| return ( | |
| <div onClick={() => onClickItem(i)}>{text}</div> | |
| ); | |
| }; |
This file contains hidden or 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
| import React, { Component } from 'react'; | |
| export default class Input extends Component { | |
| constructor(props) { | |
| super(props); | |
| this.state = { | |
| value: '' | |
| }; | |
| this.handleChange = this.handleChange.bind(this); | |
| this.handleKeyPress = this.handleKeyPress.bind(this); |
OlderNewer