Binquan Wang Binquan Wang - 10 days ago 5
Javascript Question

why my collapse default is not hidden

render() {
var item = this.props.data
return (
<li key={item.id} className="faq-item-li" id={"faq-item-li-" + item.counter}>
<h4 data-toggle="collapse" data-target={"#answer"+ item.id} >{item.title}</h4>
<div id={"answer"+ item.id} class="collapse">{item.description}</div>
</li>
);
}


div
part default is always shown. I want this part to be hidden first

Answer

Try replacing class='collapse' by className='collapse'

Comments