Skip to content

Commit 9c75021

Browse files
committed
build: bump 5.18.0
1 parent f988cb5 commit 9c75021

File tree

3 files changed

+32
-17
lines changed

3 files changed

+32
-17
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
# [5.18.0](https://github.com/rsuite/rsuite-table/compare/5.17.0...5.18.0) (2023-11-24)
2+
3+
### Features
4+
5+
* **Table:** add support function type for children prop ([#474](https://github.com/rsuite/rsuite-table/pull/474))
6+
17
# [5.17.0](https://github.com/rsuite/rsuite-table/compare/5.16.0...5.17.0) (2023-11-17)
28

39

README.md

Lines changed: 25 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,17 @@ A React table component.
3838
## Install
3939

4040
```sh
41-
npm i rsuite-table --save
41+
# use npm
42+
npm i rsuite-table
43+
44+
# or use yarn
45+
yarn add rsuite-table
46+
47+
# or use pnpm
48+
pnpm add rsuite-table
4249
```
4350

44-
### Usage
51+
## Usage
4552

4653
```tsx
4754
import { Table, Column, HeaderCell, Cell } from 'rsuite-table';
@@ -233,13 +240,6 @@ const NameCell = ({ rowData, ...props }) => (
233240
| scrollPosition | {top:number,left:number} | The scroll position of the table |
234241
| scrollTop | (top:number)=>void | Set the number of pixels for vertical scrolling of the table |
235242

236-
[npm-badge]: https://img.shields.io/npm/v/rsuite-table.svg?style=flat-square
237-
[npm]: https://www.npmjs.com/package/rsuite-table
238-
[coverage-badge]: https://img.shields.io/coveralls/rsuite/rsuite-table.svg?style=flat-square
239-
[coverage]: https://coveralls.io/github/rsuite/rsuite-table
240-
[actions-svg]: https://github.com/rsuite/rsuite-table/workflows/Node.js%20CI/badge.svg?branch=main
241-
[actions-home]: https://github.com/rsuite/rsuite-table/actions?query=branch%3Amain+workflow%3A%22Node.js+CI%22
242-
243243
### Type safety
244244

245245
We can pass generic type parameters to Table, Cell etc. for better type-safety when using typescript.
@@ -248,7 +248,7 @@ Passing a render prop to Table is recommended when using TS, as this will ensure
248248
the right generic type parameter is automatically propagated to the Cell component.
249249

250250
```ts
251-
const products: Product[] = [{ name: "Pineapple" }];
251+
const products: Product[] = [{ name: 'Pineapple' }];
252252

253253
<Table<Product, string> ref={table} data={products}>
254254
{({ Column, HeaderCell, Cell }) => (
@@ -266,7 +266,7 @@ const products: Product[] = [{ name: "Pineapple" }];
266266
In fact, the type parameter from table can be inferred from the data passed to it, so the type parameter to Table can also be skipped.
267267

268268
```ts
269-
const products: Product[] = [{ name: "Pineapple" }];
269+
const products: Product[] = [{ name: 'Pineapple' }];
270270

271271
<Table data={products}>
272272
{({ Column, HeaderCell, Cell }) => (
@@ -284,16 +284,25 @@ When writing reusable components, it is recommended to make your components gene
284284

285285
```ts
286286
interface ImageCellProps<TKey extends string, TRow extends Record<TKey, string>> {
287-
rowData: TRow,
288-
dataKey: TKey,
287+
rowData: TRow;
288+
dataKey: TKey;
289289
// ... any other props
290290
}
291291

292-
const ImageCell = <TKey extends string, TRow extends Record<TKey, string>>(
293-
{ rowData, dataKey, ...rest }: ImageCellProps<TKey, TRow>
294-
) => (
292+
const ImageCell = <TKey extends string, TRow extends Record<TKey, string>>({
293+
rowData,
294+
dataKey,
295+
...rest
296+
}: ImageCellProps<TKey, TRow>) => (
295297
<Cell<TRow, TKey> {...rest}>
296298
<img src={rowData[dataKey]} width="50" />
297299
</Cell>
298300
);
299301
```
302+
303+
[npm-badge]: https://img.shields.io/npm/v/rsuite-table.svg?style=flat-square
304+
[npm]: https://www.npmjs.com/package/rsuite-table
305+
[coverage-badge]: https://img.shields.io/coveralls/rsuite/rsuite-table.svg?style=flat-square
306+
[coverage]: https://coveralls.io/github/rsuite/rsuite-table
307+
[actions-svg]: https://github.com/rsuite/rsuite-table/workflows/Node.js%20CI/badge.svg?branch=main
308+
[actions-home]: https://github.com/rsuite/rsuite-table/actions?query=branch%3Amain+workflow%3A%22Node.js+CI%22

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "rsuite-table",
3-
"version": "5.17.0",
3+
"version": "5.18.0",
44
"description": "A React table component",
55
"main": "lib/index.js",
66
"typings": "lib/index.d.ts",

0 commit comments

Comments
 (0)