Closed rassie closed 5 years ago
The problem is that material-ui is not correctly forwarding refs
. However, it has an alternative API called innerRef
(https://material-ui.com/customization/css-in-js/#withstyles-styles-options-higher-order-component). You need to pass the ref into it.
v4 will start forwarding refs https://next.material-ui.com/guides/migration-v3/#core
Thanks, I'll look into it!
For the history: I haven't been able to use innerRef
for this, but with RootRef
it's working fine. It looks like this (List
is Material-UI's List
):
<RootRef rootRef={props.ref}>
<List {...props}>{children}</List>
</RootRef>
I'm trying to use
react-movable
with Material UI (e.g.List
component) and fail at that. The main problem seems to be that Material UI wraps its components in a HOC for styling, which does not have achildren
property, whichreact-movable
expects to exist. Replacing a component with HTML-like components like<ul>
works more or less as expected, however can't be a solution in a component world.