diff --git a/README.md b/README.md index d6c2710..e55a6be 100644 --- a/README.md +++ b/README.md @@ -96,6 +96,7 @@ These are the default props for the main react component `` // Callbacks onChange: (state, instance) => null, // Anytime the internal state of the table changes, this will fire + onTrClick: (row, event) => null, // Handler for row click events // Text previousText: 'Previous', @@ -290,7 +291,7 @@ If you would like to help develop a suggested feature follow these steps: - Fork this repo - `npm install` -- `npm watch` +- `npm run watch` - Implement your changes to files in the `src/` directory - Submit PR for review @@ -300,7 +301,7 @@ If you would like to preview your changes, you can link and utilize the example - `cd example` - `npm install` - `npm link react-table` -- `npm watch` +- `npm run watch` - Make changes to the example in `src/screens/index.js` if needed - View changes at `localhost:8000` diff --git a/package.json b/package.json index ce32e37..8b82471 100644 --- a/package.json +++ b/package.json @@ -35,7 +35,7 @@ "classnames": "^2.2.5" }, "peerDependencies": { - "react": "^15.3.1" + "react": "^15.x.x" }, "devDependencies": { "babel-cli": "6.14.0", diff --git a/src/index.js b/src/index.js index ac68ff8..b3c1d7c 100644 --- a/src/index.js +++ b/src/index.js @@ -23,6 +23,7 @@ export const ReactTableDefaults = { tbodyClassName: '', trClassName: '', trClassCallback: d => null, + onTrClick: () => null, thClassName: '', thGroupClassName: '', tdClassName: '', @@ -358,6 +359,7 @@ export default React.createClass({ return ( this.props.onTrClick(rowInfo.row, event)} className={classnames(this.props.trClassName, this.props.trClassCallback(rowInfo))} style={Object.assign({}, this.props.trStyle, this.props.trStyleCallback(rowInfo))} >