[ListItem] - Unable to provide props to li node
See original GitHub issueIf I understand your ListItem.js correctly, one small change would make it a lot easier to build
export default class DraggableListItem extends ListItem {}
In the ListItem.js you have
return (
<li
style={style}
className={cn('md-list-item', {
'md-list-item--nested-container': nestedItems,
}, className)}
ref={this._setContainer}
>
<AccessibleFakeInkedButton
{...props}
__SUPER_SECRET_REF__={this._setTile}
and by using the {...props}
for the <AccessibleFakeInkedButton />
you cannot further specialize the component.
I propose to let the ListItem be all about standard <li>
and have the {...props}
added to the <li>
Issue Analytics
- State:
- Created 7 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
[ListItem] <ListItem component /> require to forwardRef #23622
Warning: Failed prop type: Invalid prop `component` supplied to `ForwardRef(ButtonBase)`. Expected an element type that can hold a ref.
Read more >How to display an unordered list (UL) with list items (LI) within ...
The first problem I notice is with index.js: import React from 'react'; import ReactDOM from 'react-dom'; import DataList from '.
Read more >Warning: Each Child in a List Should Have a Unique 'key' Prop
When creating a list in the UI from an array with JSX, you should add a key prop to each child and to...
Read more >ListItem API - Material UI - MUI
Name Type Default
alignItems 'center' | 'flex‑start' 'center'
autoFocus bool false
button bool false
Read more >React anti-pattern: don't make <li> your component's root
const ArticleList = (props) => { return <div class="articles"> <ul class="article-list"> { props.articles.map(article => <li ...
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 Free
Top 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
This might work. I might need to update the documentation a bit and hopefully give some better migration warnings. The current ListItem looks like this.
It might be that a new prop
itemProps
is added instead. One of the main reasons for passing all the remaining props to theAccessibleFakeInkedButton
is so that the following is possible:Another possibility is to just extract any of the event listeners and apply them to the
ItemComponent
instead of theAccessibleFakeButton
. I think it’ll just take some testing.I’m going to close this one in favor of #439