Customer list change list does not work in material-ui

I used the selected list, but if I wrote a custome list, the list will not be selected. If I use listitem directly, a list can be selected.

var DataCenterRow = React.createClass({ render: function () { return ( < ListItem primaryText = {this.props.datacenter.name} rightIconButton= {rightIconMenu} value={this.props.index} onTouchTap= {this.selectItem}/> ); } }); module.exports = DataCenterRow 
+6
source share
1 answer

If you look at the source code of makeSelectable , a check appears for muiName === 'ListItem', so make sure that your configured ListItem is of type "ListItem".

 ES6: static muiName = 'ListItem'; ES5: DataCenterRow.muiName = 'ListItem'; 

Remember to make the DataCenterRow a style received externally (since makeSelectable will go through selectedItemStyle to the selected item)

0
source

All Articles