Answer the question
In order to leave comments, you need to log in
Why is the application not redrawing after state update?
Hello! There is a small table with data in React, and pagination is attached to it. According to it, the output of 5 objects is configured. I want to add the ability to select the number of displayed objects so that you can display 3, 5, 10, etc. at the request of the user.
To do this, I created buttons under the table, and hung a handler on each (with different numbers, respectively)
onClick={()=>this.setState({pageRangeDisplayed: 3})}
, which changes the corresponding field in the state to the desired number (3.5, etc.). Well, further from the state, this number comes to the props of the component, which draws the table. Answer the question
In order to leave comments, you need to log in
False alarm, used react-paginate to display pagination and inattentively looked at how it works, problem solved.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question