Skip to content

Commit a4c20c5

Browse files
authored
Update Changelog (v10.6.0) (#1466)
* Update Changelog (v10.6.0) * Apply Requested Changes (Part 1)
1 parent ea195bf commit a4c20c5

File tree

1 file changed

+28
-3
lines changed

1 file changed

+28
-3
lines changed

changelog.md

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,35 @@ Since you are interested in what happens next, in case, you work for a for-profi
44

55
---
66

7-
### Bug fixes
8-
97
### Improvements
108

9+
- [jss] `Styles` now supports `ClassNames`, `Props`/`Data`, and `Theme` as type parameters (eg. `Styles<Names, Data, Theme>`). [1460](https://github.com/cssinjs/jss/pull/1460)
10+
- [react-jss] `withStyles` and `createUseStyles` now support `ClassNames`, `Props`, and `Theme` as type parameters (eg. `createUseStyles<Names, Props, Theme>`). [1460](https://github.com/cssinjs/jss/pull/1460)
11+
- [react-jss] `useStyles` finally expects the correct argument type: a `Props` object with an optional `Theme` property (both determined from `createUseStyles`). [1460](https://github.com/cssinjs/jss/pull/1460)
12+
13+
### Breaking Changes
14+
15+
- [react-jss] `Theme` is no longer the first generic type parameter for `createUseStyles`. [1460](https://github.com/cssinjs/jss/pull/1460)
16+
- There are two main ways to tell TypeScript your `Theme`'s type without reaching over the other type parameters:
17+
18+
Using the function argument.
19+
20+
```typescript
21+
const useStyles = createUseStyles(theme: Theme => ({
22+
ruleName: { /* ... */ };
23+
}))
24+
```
25+
26+
Using the object argument with a function. (You will only need to specify the `Theme` type once.)
27+
28+
```typescript
29+
const useStyles = createUseStyles({
30+
ruleName: ({theme}: {theme: Theme}) => ({
31+
/* ... */
32+
})
33+
})
34+
```
35+
1136
## 10.5.1 (2021-1-23)
1237

1338
### Bug fixes
@@ -34,7 +59,7 @@ Since you are interested in what happens next, in case, you work for a for-profi
3459
- [*] Remove test files from the package [1406](https://github.com/cssinjs/jss/pull/1406)
3560
- [*] Upgrade rollup [1426](https://github.com/cssinjs/jss/pull/1426)
3661
- [*] Upgrade flow to 0.138.0 [1425](https://github.com/cssinjs/jss/pull/1425)
37-
- [jss-plugin-default-unit] aAdd gap unit [1403](https://github.com/cssinjs/jss/pull/1403)
62+
- [jss-plugin-default-unit] Add gap unit [1403](https://github.com/cssinjs/jss/pull/1403)
3863
- [jss-plugin-default-unit] Add default units to logical properties [1415](https://github.com/cssinjs/jss/pull/1415)
3964
- [jss] Improve deleteRule() performance [1424](https://github.com/cssinjs/jss/pull/1424)
4065

0 commit comments

Comments
 (0)