import React, { Component } from 'react'; import { connect} from 'react-redux'; import * as actions from "../actions/searchStaffAction"; import { bindActionCreators } from "redux"; import SearchStaffsPage from "../components/SearchStaffsPage" import LeftMenu from '../container/LeftMenu' import Header from '../container/Header' class SearchStaff extends Component { componentDidMount(){ const { searchStaff, match } = this.props searchStaff(match.params.title) } render() { console.log(this.props) return (
); } } const mapStateToProps = state => ({ searchData: state.searchStaff.searchData, isFetching: state.searchStaff.isFetching, }); const mapDispatchToProps = dispatch => bindActionCreators({ ...actions }, dispatch); export default SearchStaff = connect( mapStateToProps, mapDispatchToProps )(SearchStaff);