You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jan 15, 2022. It is now read-only.
I'm developing a table that would contain different content in some columns, depending on some features on the data line. I've created it already using pure HTML tables, and my approach is to have different classes for different item types, such as:
//based on http://stackoverflow.com/a/29876284/102960constTypes={type1: Type1Line,type2: Type2Line}classPageextendsComponent{render(){<table>{this.props.stuff.map(thing=>{letThingLine=Types[thing.type]return<ThingLinekey={thing.id}thing={thing}/>})}</table>}}classType1LineextendsComponent{render(){return<tr><td>{this.props.thing.name}</td></tr>}}classType2LineextendsComponent{render(){return<tr><td>Special: {this.props.thing.name}</td></tr>}}
This is an over simplification, just to understand the code structure, but there are several other rules to justify the use of different "TR types".
However, I tried to bring Reactable to this structure as we will also need filtering and paging, but... It does not work. Lines are only rendered if they're precisely Tr. Not even extending from Tr instead of render()ing Trs works.
Would it be hard to make the code more extensible, allowing for Tr sub-classing?