Open alcedoatthis opened 7 years ago
@alcedoatthis this does not make any sense, without value from connected state you don't need onion form at all..
@ondrejbartas Current api is kept, if You don't pass value as a prop to component. Is there any example of functionality mentioned? IMHO other options like hooking setFieldValue
into componentWillReceiveProps
seems to be hacky. What about optional argument to connectField? mergeProps(stateProps, dispatchProps, ownProps): props
passed to connect. Something like:
export default function connectField(fieldName, ..., mergeProps) {
return FieldComponent => {
@connect(
(state, { onionFormName }) => ({...}),
(dispatch, { onionFormName }) => ({...}),
mergeProps
) // ...
Useful e.g. for check/uncheck all checkbox. Value can be combined from other values and passed directly to check-all checkbox. IMHO it is better to move
{...rest}
props below others, but I'm not sure if this behaviour is wanted (?)