title: What is the best practice to set initial state in reactjs constructor redux?
body: <p>I'm using reactjs and redux for my application. This is a piece of code from my Dashboard component. just wonder if assigning state with hard coded value in my constructor is considered bad practice. </p>
  
  <pre><code>export class Dashboard extends React.Component{
  
      constructor(props, context) {
          super(props, context);
          this.state={
              dashboardRequest : {
                  groupingFilter  : 0, paginationInfo :{ currentPage : 1, pageSize : 5} ,  sortInfo : {sortBy  : 'grossNotional', ascending : true}
              }
          };
          autoBind(this);
      }
  
      onChange(current){
          const dashboardRequest = this.state.dashboardRequest;
          dashboardRequest.paginationInfo.currentPage = current;
          this.setState({dashboardRequest : dashboardRequest});
          this.props.actions.fetchDashboard(this.state.dashboardRequest);
      }
  }
  function mapStateToProps(state) {
      return {
          dashboard: state.dashboard,
          isLoading : state.dashboard.isLoading,
          isOverflow : state.dashboard.isOverflow,
      };
  }
  
  function mapDispatchToProps(dispatch) {
      return {
          actions: bindActionCreators(AppActions, dispatch)
      };
  }
  
  export default connect(
      mapStateToProps,
      mapDispatchToProps
  )(Dashboard);
  
  export const dashboardReducer = (previousState = { }, action) =&gt; {
      let {type, ...actionData} = action;
      switch (type) {
          case 'LOAD_DASHBOARD_DATA':
              return {...previousState, ...actionData};
          case 'ADD_DASHBOARD_DATA':
              return {...previousState, ...actionData};
          default:
              return previousState;
      }
  };
  </code></pre>