Is there any solution to import dynamically below redux action and use it?
import { set } from 'actions/formula-form';
Solved!:
const action = require('actions/' + props.action);
dispatch(action.set({ formulaId: dataItem.id }));
};
Is there any solution to import dynamically below redux action and use it?
import { set } from 'actions/formula-form';
Solved!:
const action = require('actions/' + props.action);
dispatch(action.set({ formulaId: dataItem.id }));
};
Try this one
import { set } from 'actions/formula-form';
import { connect } from "react-redux";
...
component() {
...
this.props.getProps(value);
...
}
const mapStateToProps = (state) => ({
getProps: state.formula-form.data,
});
const mapDispatchToProps = {
set,
};
export default connect(mapStateToProps, mapDispatchToProps)(DashBoard);