material-react-table 0.23.3 → 0.23.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. package/README.md +13 -1
  2. package/package.json +3 -3
package/README.md CHANGED
@@ -12,6 +12,9 @@
12
12
  <a href="https://github.com/KevinVandy/material-react-table" target="_blank_">
13
13
  <img alt="" src="https://img.shields.io/github/stars/KevinVandy/material-react-table.svg?style=social&label=Star" />
14
14
  </a>
15
+ <a href="http://makeapullrequest.com" target="_blank_">
16
+ <img alt="" src="https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square" />
17
+ </a>
15
18
 
16
19
  ---
17
20
 
@@ -108,7 +111,7 @@ npm install material-react-table
108
111
  > Read the full usage docs [here](https://www.material-react-table.com/docs/usage/)
109
112
 
110
113
  ```jsx
111
- import React, { useMemo } from 'react';
114
+ import React, { useMemo, useState, useEffect } from 'react';
112
115
  import MaterialReactTable from 'material-react-table';
113
116
 
114
117
  export default function App() {
@@ -145,6 +148,13 @@ export default function App() {
145
148
  [],
146
149
  );
147
150
 
151
+ //optionally, you can manage any/all of the table state yourself
152
+ const [rowSelection, setRowSelection] = useState({});
153
+
154
+ useEffect(() => {
155
+ //do something when the row selection changes
156
+ }, [rowSelection]);
157
+
148
158
  return (
149
159
  <MaterialReactTable
150
160
  columns={columns}
@@ -152,6 +162,8 @@ export default function App() {
152
162
  enableColumnOrdering //enable some features
153
163
  enableRowSelection
154
164
  enableStickyHeader
165
+ onRowSelectionChange={setRowSelection} //hoist internal state to your own state (optional)
166
+ state={{ rowSelection }} //manage your own state, pass it back to the table (optional)
155
167
  />
156
168
  );
157
169
  }
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.23.3",
2
+ "version": "0.23.4",
3
3
  "license": "MIT",
4
4
  "name": "material-react-table",
5
5
  "description": "A fully featured Material UI implementation of TanStack React Table, inspired by material-table and the MUI X DataGrid, written from the ground up in TypeScript.",
@@ -62,7 +62,7 @@
62
62
  "@emotion/styled": "^11.9.3",
63
63
  "@faker-js/faker": "^7.3.0",
64
64
  "@mui/icons-material": "^5.8.4",
65
- "@mui/material": "^5.8.7",
65
+ "@mui/material": "^5.9.0",
66
66
  "@size-limit/preset-small-lib": "^7.0.8",
67
67
  "@storybook/addon-a11y": "^6.5.9",
68
68
  "@storybook/addon-actions": "^6.5.9",
@@ -100,7 +100,7 @@
100
100
  },
101
101
  "dependencies": {
102
102
  "@tanstack/match-sorter-utils": "8.1.1",
103
- "@tanstack/react-table": "8.2.3",
103
+ "@tanstack/react-table": "8.2.6",
104
104
  "react-virtual": "^2.10.4"
105
105
  }
106
106
  }