I'm trying to get the initialValues of the form setup as follows but it doesn't work:
const mapStateToProps = (state, props) => ({
initialValues: state.charts[props.resourceId],
});
const mapDispatchToProps = ...
export default reduxForm({
form: 'ChartForm',
})(connect(mapStateToProps, mapDispatchToProps)(ChartForm));
Of course if I do something like this will work:
export default reduxForm({
form: 'ChartForm',
initialValues: {
title: "Some Title",
...
}
})(connect(mapStateToProps, mapDispatchToProps)(ChartForm));
That is not what I need though. I need to get the initial values from a resource in my store that has id == this.props.resourceId
Could anybody point out what is wrong with the first solution?