I am trying to make a inline for loop for my pagination in react js but it doesn't seem to be working im curious to if anyone has an idea of how to do it.
currently I am doing this:
<ul class="pagination">
<li>
<a href="#" aria-label="Previous">
<span aria-hidden="true">«</span>
</a>
</li>
{this.state.searching ?
''
:
Code for page buttons here
}
<li>
<a href="#" aria-label="Next">
<span aria-hidden="true">»</span>
</a>
</li>
</ul>
I am using the bootstrap pagination so i dont really need any styles but the problem is i want it to dynamically change how many pages are displayed based on how many things the search returns.
I want to display 3 results per page and the amount of results is stored in my state as amountofjobs
TL:DR Create loop to dynamically display pagination page buttons based on search not working.
i was trying to do this:
for(i = 0; i < this.state.amountofjobs / 3; i++){
with normal jsx/html here to display but it kept saying i was missing an expression
}