Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to pass value from top #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

alcedoatthis
Copy link

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 (?)

@alcedoatthis alcedoatthis self-assigned this Mar 9, 2017
@ondrejbartas
Copy link
Contributor

@alcedoatthis this does not make any sense, without value from connected state you don't need onion form at all..

@alcedoatthis
Copy link
Author

alcedoatthis commented Mar 10, 2017

@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
    ) // ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants