阅读背景:

添加/删除css类以响应组件

来源:互联网 

I have a react component for pagination called 'Pager', depending on the number of results and the size of the page it calculates the number of pages to display, and then, when clicking on a link, it fetchs the results for that page. In my case, I'm having problem on adding/removing the css class dinamically when a user click on a link. When the page is rendered the first time only the number '1' has to be 'active', but then when the user clicks on the link '2', '3', etc I need to remove the className attribute for the previous active link and add it to the clicked link.I have a react component for pagination called




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: