I get TypeError: Cannot read property 'props' of undefined
. I need to my Li
component to receive props
. I'm using styled-component by the way.
const Li = styled.li`
border-top: 0 none;
`;
class Popular extends Component {
render() {
var languages = ['All', 'Javascript', 'Java', 'Python'];
return (
<ul className='list-group'>
{languages.map(function(lang){
return (
<Li className={`list-group-item p-2 ${this.props.className}`}>
{lang}
</Li>
)
})}
</ul>
);
}
}
export default Popular;