Open
Description
Hi! To continue our conversation at #46
In 2.1.0 you added mapThemrProps
with example:
function mapThemrProps(props, theme) {
const { composeTheme, innerRef, mapThemrProps, themeNamespace, ...rest } = props;
return { ...rest, withRef: innerRef, theme };
}
But withRef
is usually boolean, for example in react-redux, so it doesn't work.
It was case, when @themr
hoc wraps another hoc. But what if vice-versa, I have places where it's wrapped by @connect
.
It used to be simple convention: In hoc's ref handler function it checked if underline instance also has getWrappedInstance and used it to take ref from it, so it's a chain when you can reach real component no matter how many hocs do you have on top of it
saveComponentRef(instance) {
this.instance = instance && instance.getWrappedInstance ? instance.getWrappedInstance() : instance;
}
But now having somewhere withRef
, somewhere innerRef
or mapThemrProps
I'm confused.
Feels like it has added complexity and problems instead of solving anything
Metadata
Metadata
Assignees
Labels
No labels