How can I select components wrapped in ForwardRef with Material UI v4?
See original GitHub issueI 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:
- Created 4 years ago
- Comments:5 (1 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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.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.