소스 검색

Code style update. Test emacs setup.

Snow 8 년 전
부모
커밋
230600a15a
2개의 변경된 파일6개의 추가작업 그리고 8개의 파일을 삭제
  1. 5 7
      src/components/Counter/index.js
  2. 1 1
      src/components/Form/index.js

+ 5 - 7
src/components/Counter/index.js

@@ -30,15 +30,13 @@ const app = (state = 0, action) => {
 };
 
 // create store
-let store = createStore(app);
+const store = createStore(app);
 
 // react component
 const StaticCounter = ({ value, handleClickAdd, handleClickMinus }) =>
   <div>
     <p>
-      This state of this counter is managed by Redux instead of React. Note that
-      the counter does not change after switching to other components because
-      the state in redux is not managed by the root component.
+      This state of this counter is managed by Redux instead of React. Note that the counter does not change after switching to other components because  the state in redux is not managed by the root component.
     </p>
     <h2>{value}</h2>
     <button onClick={handleClickAdd}>Add </button>
@@ -48,16 +46,16 @@ const StaticCounter = ({ value, handleClickAdd, handleClickMinus }) =>
 StaticCounter.propTypes = {
   value: PropTypes.number.isRequired,
   handleClickAdd: PropTypes.func.isRequired,
-  handleClickMinus: PropTypes.func.isRequired
+  handleClickMinus: PropTypes.func.isRequired,
 };
 // activate the container StaticCounter
-const mapStateToProps = state => {
+const mapStateToProps = (state) => {
   return {
     value: state
   };
 };
 
-const mapDispatchToProps = dispatch => {
+const mapDispatchToProps = (dispatch) => {
   return {
     handleClickAdd: () => {
       dispatch(add());

+ 1 - 1
src/components/Form/index.js

@@ -14,7 +14,7 @@ export class InputWithPlaceHolder extends React.Component {
       });
     }
   };
-
+   
   handleChange = event => {
     this.setState({
       value: event.target.value