React-table: immutable.js support

Created on 26 Apr 2017  路  12Comments  路  Source: tannerlinsley/react-table

Do you want support immutable.js List as data (may be with Record rows)?

Now I have to convert long immutable redux state List to JS array.

In the case of using Immutable.List as data, I got:

screen shot 2017-04-26 at 23 42 26

Most helpful comment

+1 for Immutable

All 12 comments

There are currently no plans to support immutable directly. This may change in the future

Support for Immutable.js would be awesome! @tannerlinsley Do you reckon it would be difficult for an external developer (maybe me) to implement this in react-table? I have no previous history with this component before today.

@tannerlinsley I too would love to see this work with immutable. With some cursory review this seems very doable, especially if those using immutable are expected to always use function based accessors. The main issue is that immutable objects to not expose a length property, instead they use size. I may take a crack at seeing if I can introduce basic support and send over a PR.

+1 this would be great.

+1 would love to see immutable.js supported as well.

+1

+1

@a-x- you are converting your list to array using toJS() to make things work right?

+1 for Immutable

how would it be to fork/implement? :0 not sure how React-Table determines whether or not a ref has changed, but it would be a great addition

I'm from future...

I've been using your library and after introducing immutable.js in full swing I came to know now that it doesn't support it. Just saddens me to the core. It's close to first release.

Two paths, either someone or I study and raise a PR. Second, I invest time to build my own table from scratch ( more time).

Will be a great upgrade if you guys can do that (less time consuming for you guys). Thanks!

@tommyalvarez, you are converting your list to array using toJS() to make things work right?

yes, sure

Also, we adding immutable support to some our custom components. It does not even require any immutable-js dependencies. Basically, we:

  • check the get(i) method and use it instead of [i]
  • check the size property and use it instead of length

I discontinued using react-table. It has also another bugs, inconvenient for us. We migrated to material-ui react kit and custom tiny wrappers

Hi! I was experiencing the same problem ( except for the 'nan' at the bottom )

React-table v 6.9.2

My solution:

let noData = pagination.results_count > 0 ? () => <span></span> : (txt) => <span>{txt.children}</span>

//txt.children shows 'no data' text defined in noDataText props

<ReactTable
manual={true}
data={data} // <----- immutable object!
NoDataComponent={noData}
(...)
/>

This will give you control to show "no data" when you want. You'll have to style it manually, but that's not a big deal.

Hope it helps someone!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dilipsundarraj1 picture dilipsundarraj1  路  3Comments

mellis481 picture mellis481  路  3Comments

LeonHex picture LeonHex  路  3Comments

dwjft picture dwjft  路  3Comments

krishna-shenll picture krishna-shenll  路  3Comments