AllenFang / AllenFang/react-bootstrap-table

Is it possible to pass pageshowtotal's data to an outter component?

Đang mở
#1,495 3 bình luận 0 reaction 0 người được giao Xem trên GitHub
enhancement in progress
Ngôn ngữ chính
JavaScript
Star
2.2k
Fork
761
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

Thanks for creating this amazing library!
I created my own component to show page infos.
Is there an example to show how to pass (from, to, total) to the outter component?

[my Page infos component]
[react-bootstrap-datatable]

I've tried the following method but it seems deadlock occurred for endless re-rendering.

```js
paginationShowsTotal = (from, to, total) => {
this.setState({message: `Total(${total}) ${from}-${to}`});
return null;
}
```

```jsx



{this.state.message}

this.paginationShowsTotal(from, to, total)}}>

```

error:
warning.js?554bc8e:36 Warning: setState(...): Cannot update during an existing state transition (such as within `render` or another component's constructor). Render methods should be a pure function of props and state; constructor side-effects are an anti-pattern, but can be moved to `componentWillMount`.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.