Skip to content

Commit

Permalink
fix(values): transformable adds onChange if set
Browse files Browse the repository at this point in the history
The `transformable` decorator injected `onChange` even if `onChange`
was not provided from the parent.
  • Loading branch information
davidbonnet committed Jun 3, 2019
1 parent c8f0292 commit 6b5ef7b
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/values.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,14 @@ export const transformable = (Component) =>
: {
...props,
value: transformValue ? state.transformedValue : props.value,
onChange: transformOnChange
? lazyProperty(
this,
'transformedOnChange',
transformedOnChange,
)
: props.onChange,
onChange:
transformOnChange && props.onChange
? lazyProperty(
this,
'transformedOnChange',
transformedOnChange,
)
: props.onChange,
},
)
}
Expand Down

0 comments on commit 6b5ef7b

Please sign in to comment.