Skip to content

Commit 42dad57

Browse files
committed
fixed bug with modifying hidden things
1 parent eba464c commit 42dad57

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ Optionally, use `modifyAll` to change every item.
4545
~~~js
4646

4747
modifyId({hidden, value, key, row}){
48-
//row is the current row object
4948
return <a href={value}>{value}</a>
5049
}
5150

@@ -70,10 +69,11 @@ modifyAll={this.modify}
7069
###hide
7170

7271
```js
73-
let modify = ({hidden}) => {
74-
expect(hidden.id).to.be.equal(1)
72+
let modify = ({hidden, value}) => {
73+
expect(hidden.id).to.be.equal(1)
74+
return value
7575
}
76-
Test(<Table rows={[{id: 1, name: 'zach'}]} hide={['id']}/>)
76+
Test(<Table rows={[{id: 1, name: 'zach'}]} hide={['id']} modifyAll={modify}/>)
7777
.find('td')
7878
.element(td => {
7979
expect(td.props.children).to.be.equal('zach');

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-legit-table",
3-
"version": "0.4.0",
3+
"version": "0.4.1",
44
"description": "the simplest table component out there",
55
"main": "lib/table.js",
66
"scripts": {

tests/table.jsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,11 @@ describe('Table component', () => {
7575
})
7676

7777
it('should hide id row', () => {
78-
let modify = ({hidden}) => {
79-
expect(hidden.id).to.be.equal(1)
78+
let modify = ({hidden, value}) => {
79+
expect(hidden.id).to.be.equal(1)
80+
return value
8081
}
81-
Test(<Table rows={[{id: 1, name: 'zach'}]} hide={['id']}/>)
82+
Test(<Table rows={[{id: 1, name: 'zach'}]} hide={['id']} modifyAll={modify}/>)
8283
.find('td')
8384
.element(td => {
8485
expect(td.props.children).to.be.equal('zach');

0 commit comments

Comments
 (0)