DEV Community

Discussion on: Fetching data from an api using React/Redux

Collapse
 
tiruvengadam85 profile image
Tiruvengadam85

I have a component, I am passing brand values to the component as props, based on props value, components call different fecth API method in action fecthOMOrder, fecthSVOrder respectively. I need to specify same condition in connect, below condition is not working, please advise, thanks in advance.

if (this.props.brand=="OM")
{
export default connect(mapStateToProps,{fecthOMOrder})(OrderList);

}
else
{
export default connect(mapStateToProps,{fecthSVOrder })(OrderList);

}