-
Notifications
You must be signed in to change notification settings - Fork 535
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
39 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
--- | ||
"@primer/components": major | ||
--- | ||
|
||
Type definitions are now being generated by TypeScript instead of manually maintained. These new type definitions may differ from the previous type definitions and cause breaking changes. If you experience any new TypeScript errors, feel free to create an [issue](https://github.com/primer/components/issues) or reach out in Slack (#design-systems). | ||
|
||
### Breaking changes | ||
|
||
* The following types are no longer exported: | ||
|
||
``` | ||
BaseProps | ||
UseDetailsProps | ||
AnchoredPositionHookSettings | ||
AnchorAlignment | ||
AnchorSide | ||
PositionSettings | ||
PaginationHrefBuilder | ||
PaginationPageChangeCallback | ||
PositionComponentProps | ||
``` | ||
|
||
* Props are now defined with types instead of interfaces which means in some cases you may not be able to create interfaces that `extend` them. To work around this issue, you may need to convert your interfaces to types: | ||
|
||
```diff | ||
import {BoxProps} from '@primer/components' | ||
|
||
- interface MyFancyBox extends BoxProps {...} | ||
+ type MyFancyBox = BoxProps & {...} | ||
``` | ||
|
||
* Some components now expect more specific ref types. For example: | ||
|
||
```diff | ||
- const ref = React.useRef<HTMLElement>(null) | ||
+ const ref = React.useRef<HTMLButtonElement>(null) | ||
|
||
return <Button ref={ref}>...</Button> | ||
``` |