WithHandlers functions are not receiving parent component's props
- Dominant language
- JavaScript
- Stars
- 12
- Forks
- 1
- PR merge metrics
- No merged PRs in 30d
Description
Let's say we have this code
```
// Render
;
function List({ data, logData }) {
return (
- {row} )}
{/* can access data */}
{data.map(row =>
);
}
export default compose(
withHandlers({
logData: props => () => {
console.log(props.data); // can’t access data
}
})
);
```
I'm expecting to receive the props from parent component into _logData_ handler. Still, I'm only receiving component props.
Adding **withObservable**((app, props$) => props$) before withHandlers fixes it.
Is that the expected behaviour? If so, do we have another way using frint-props to access the parent props.
After some research it seems that the handler functions receive 3 params. App, props, parentProps$.
**parentProps$** has access to data as per the above example. Still, as a developer I expect the compose function will compose into the handlers the component, and parent component props.
Contributor guide
Assessment
This issue has not been assessed yet.