diary

Time is your most valuable asset (till immortality)

View the Project on GitHub boyangwang/diary

Front

components

app - view - container - object

when not react component, use tag. button/div etc

className

same as component class name, e.g. DiaryApp

import sequence

When one import statement imports multiple kinds, e.g. import Component, { nonComponent } from 'foobar', take the highest precedence

component boilerplate

We all hate this, but…

import React from 'react';
import { connect } from 'react-redux';
import { Icon } from 'antd';

import { ReduxState, User } from 'reducers';
import { dispatch } from 'reducers/store';
import api from 'utils/api';
import util from 'utils/util';

class State {
  public someState: string = 'someState';
}
class Props {
  public someProp: string = 'someProp';
}
class ReduxProps {
  public user: User | null;
  public reduxPropFromState: string;
}
class SomeComponent extends React.Component<Props & ReduxProps, State> {
  public constructor(props: Props & ReduxProps) {
    super(props);
    this.state = new State();
  }

  public render() {
    return (
      <div>SomeComponent</div>
    );
  }
}
export default connect<ReduxProps, {}, Props>((state: ReduxState) => {
  return {
    user: state.user,
    reduxPropFromState: state.reduxPropFromState,
  };
})(SomeComponent);
import React from 'react';
import { connect } from 'react-redux';

import { ReduxState } from 'reducers';
import { dispatch } from 'reducers/store';

class Props {
}
class ReduxProps {

}
class State {

}
class TodoCheckedListContainer extends React.Component<Props & ReduxProps, State> {
  public constructor(props: Props & ReduxProps) {
    super(props);
    this.state = new State();
  }

  public render() {
    return null;
  }
}
export default connect<ReduxProps, {}, Props>((state: ReduxState) => {
  return {};
})(TodoCheckedListContainer);

isomorphicUtils sharedUtils 问题

Module not found: You attempted to import ../../../isomorphicUtils which falls outside of the project src/ directory. Relative imports outside of src/ are not supported. You can either move it inside src/, or add a symlink to it from project's node_modules/

So add a symlink from outer to front/src. This might make it incompatible with Windows. We see how…

整体来说还是有点问题, 先后解决的步骤:

reminder

getReminders 返回所有reminder, 前端做判别和展示