How to use the react-redux/es/connect/connect function in react-redux

To help you get started, we’ve selected a few react-redux examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github yhtml5 / yhtml5-app / apps / test-tools / src / Containers / SettingList / index.jsx View on Github external
hidden: hidden || false,
    // onPress: onPress || function () { },
  }
  return (
    
  )
}

const mapStateToProps = (state) => {
  return {
    tabBarNav: state.tabBarNav,
    router: state.router,
  }
}

export default connect(
  mapStateToProps,
  // mapDispatchToProps
)(Component)
github yhtml5 / yhtml5-app / apps / test-tools / src / Containers / TabBarNav / index.jsx View on Github external
const mapStateToProps = (state) => {
  return {
    tabBarNav: state.tabBarNav,
    router: state.router,
  }
}

// const mapDispatchToProps = (dispatch) => {
//   return {
//     onPress: (selectedTab) => {
//       dispatch(updateState(selectedTab))
//     }
//   }
// }

export default connect(
  mapStateToProps,
  // mapDispatchToProps
)(Component)
github bounswe / bounswe2018group5 / frontend / src / views / HomePage / HomePage.jsx View on Github external
}

function bindAction(dispatch) {
    return {
        tryGetProjects: () => dispatch(tryGetProjects()),
        getProjectsReset: () => dispatch(getProjectsReset()),
        tryGetRecommendedProjects: (user_id) => dispatch(tryGetRecommendedProjects(user_id)),
        getRecommendedProjectsReset: () => dispatch(getRecommendedProjectsReset())
    };
}

const mapStateToProps = state => ({
    project: state.project
});

export default connect(
    mapStateToProps,
    bindAction
)(withStyles(homePageStyle)(HomePage));
github pennlabs / penn-courses / frontend / plan / src / components / selector / Selector.js View on Github external
isSearchingCourseInfo,
    }
);


const mapDispatchToProps = dispatch => (
    {
        getCourse: courseId => dispatch(fetchCourseDetails(courseId)),
        clearCourse: () => dispatch(updateCourseInfo(null)),
        addToSchedule: section => dispatch(addSchedItem(section)),
        removeFromSchedule: id => dispatch(removeSchedItem(id)),
        setScrollPos: scrollPos => dispatch(updateScrollPos(scrollPos)),
    }
);

export default connect(mapStateToProps, mapDispatchToProps)(Selector);
github scouter-contrib / scouter-paper / src / components / Paper / LineChart / Line.js View on Github external
timeFocus: state.timeFocus,
        range: state.range,
    };
};

let mapDispatchToProps = (dispatch) => {
    return {
        setTimeFocus: (active, time, boxKey,keep) => dispatch(setTimeFocus(active, time, boxKey,keep)),
        setRealTimeValue: (realTime, longTerm, value) => dispatch(setRealTimeValue(realTime, longTerm, value)),
        setRangeDateHoursMinutes: (date, hours, minutes) => dispatch(setRangeDateHoursMinutes(date, hours, minutes)),
        setRealTimeRangeStepValue: (realTime, longTerm, value, range, step) => dispatch(setRealTimeRangeStepValue(realTime, longTerm, value, range, step)),
        setSearchCondition: (from, to, time) => dispatch(setSearchCondition(from, to, time)),
    };
};

Line = connect(mapStateToProps, mapDispatchToProps)(Line);
export default withRouter(Line);
github kontur-edu / Ulearn / src / Frontend / src / containers / CommentSendForm.js View on Github external
return {
		account: state.account,
	}
}

function mapDispatchToProps(dispatch, state) {
	return {
		enterToCourse: (text) => dispatch({
			type: COURSES__COURSE_ENTERED,
			courseId: state.courseId,
			slideId: state.slideId,
		}),
	}
}

export default connect(mapStateToProps, mapDispatchToProps)(CommentSendForm);
github bounswe / bounswe2018group5 / frontend / src / components / Modal / AddPortfolioModal.jsx View on Github external
function bindAction(dispatch) {
    return {
        tryPostPortfolio: (title, description, date, project_id, tags) => dispatch(tryPostPortfolio(title, description, date, project_id, tags)),
        postPortfolioReset: () => dispatch(postPortfolioReset()),
        tryGetTag: (tags) => dispatch(tryGetTag(tags)),
        getTagReset: () => dispatch(getTagReset())
    };
}

const mapStateToProps = state => ({
    user: state.user,
    project: state.project
});

export default connect(
    mapStateToProps,
    bindAction
)(withStyles(modalStyle)(AddPortfolioModal));
github mhacks / mhacks-web / app / pages / home / index.jsx View on Github external
);
    }
}

function mapStateToProps(state) {
    return {
        theme: state.theme.data
    };
}

export default connect(mapStateToProps)(HomePage);
github GenesisVision / web-client / src / pages / manager / manager.page.js View on Github external
}
}
const mapStateToProps = state => {
  return {
    managerProfile: state.manager.data
  };
};

const mapDispatchToProps = dispatch => {
  return {
    service: bindActionCreators({ ...managerService, goBack }, dispatch)
  };
};

export default translate()(
  connect(
    mapStateToProps,
    mapDispatchToProps
  )(ManagerPage)
);