question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How can I select components wrapped in ForwardRef with Material UI v4?

See original GitHub issue

I am troubled with the same problem as this article written in stackoverflow. https://stackoverflow.com/questions/55026027/how-can-i-select-components-wrapped-in-forwardref-with-material-ui-v4

I created the following component in Material-UI v4.1.2. I am in trouble because I can not select the elements below Drawer.

import Drawer from '@material-ui/core/Drawer';
import List from '@material-ui/core/List';
import ListItem from '@material-ui/core/ListItem';
import ListItemText from '@material-ui/core/ListItemText';

function App() {
  return (
    <div className="App">
      <Drawer variant="permanent" anchor="left">
        <List>
          {['All mail', 'Trash', 'Spam'].map((text) => (
            <ListItem button key={text}>
              <ListItemText primary={text} />
            </ListItem>
          ))}
        </List>
      </Drawer>
    </div>
  );
}

Please tell me how to access Drawer or ListItem.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
arubtsovcommented, Jul 10, 2019

Thank you for providing us with additional details and for sharing ideas concerning the implementation! On the one hand, passing the component’s constructor instead of its name into the ReactSelector function is clear in terms of API. On the other hand, the context in which TestCafe executes a test doesn’t match the browser context, so it will be impossible to compare it with something on the client side directly. Our team will need time to research this issue in detail. Your patience is greatly appreciated.

0reactions
github-actions[bot]commented, Dec 20, 2022

We’re closing this issue after a prolonged period of inactivity. If it still affects you, please add a comment to this issue with up-to-date information. Thank you.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How can I select components wrapped in ForwardRef with ...
Now with version 4 the document appears as ForwardRef(List) in the react- dev-tools, but selecting for this with ReactSelector('ForwardRef(List)') ...
Read more >
Composition - Material UI
Composition. MUI tries to make composition as easy as possible. Wrapping components. To provide maximum flexibility and performance, MUI needs a way to...
Read more >
Forwarding Refs
Forwarding refs to DOM components · We create a React ref by calling React. · We pass our ref down to <FancyButton ref={ref}>...
Read more >
DevAsking.com - The issue How can I select components...
How can I select components wrapped in ForwardRef with Material UI v4 ? ... by Declan McLaughlin] I created the following component in...
Read more >
warning: function components cannot be given refs. ...
Asked May 4, 2022 • 0 votes 0 answer ... Unfortunately Material UI 4 is not supported yet. ... The solution is to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found