Skip to content

refactor(project): update TypeScript definitions for React 18 - #2664

Merged
joshblack merged 27 commits into
ci/add-react-18-testfrom
feat/update-types-for-react-18
Dec 15, 2022
Merged

refactor(project): update TypeScript definitions for React 18#2664
joshblack merged 27 commits into
ci/add-react-18-testfrom
feat/update-types-for-react-18

Conversation

@joshblack

Copy link
Copy Markdown
Member

Update TypeScript types for React 18. The goal for this is to support both React 18 and React 17 types.

Some of the changes included:

  • useCallback needed the arguments to be typed
  • VFC is deprecated in React 18
  • Slot had an issue with children being a generic function
  • Dependent packages on older type versions of React that are missing the children prop (like react-dnd)

@joshblack
joshblack requested review from a team and langermankDecember 7, 2022 19:55
@changeset-bot

changeset-botBot commented Dec 7, 2022

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 9b87ecd

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
NameType
@primer/reactMinor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@joshblack

Copy link
Copy Markdown
MemberAuthor

@siddharthkp would love your feedback on how to make Slots work with generic children if you have a sec! I feel like the changes I made to get it working are not really correct and we would need to make the context itself generic, potentially.

@joshblackjoshblack changed the title Feat/update types for react 18refactor(project): update TypeScript definitions for React 18Dec 7, 2022
@github-actions

github-actionsBot commented Dec 7, 2022

Copy link
Copy Markdown
Contributor

size-limit report 📦

PathSize
dist/browser.esm.js82.79 KB (+0.06% 🔺)
dist/browser.umd.js83.47 KB (+0.08% 🔺)

@github-actions
github-actionsBot temporarily deployed to storybook-preview-2664 December 7, 2022 20:02 Inactive
@joshblack
joshblack temporarily deployed to github-pages December 7, 2022 20:02 — with GitHub Actions Inactive
@github-actions
github-actionsBot temporarily deployed to storybook-preview-2664 December 7, 2022 20:03 Inactive
@joshblack
joshblack temporarily deployed to github-pages December 8, 2022 22:57 — with GitHub Actions Inactive
@github-actions
github-actionsBot temporarily deployed to storybook-preview-2664 December 8, 2022 22:58 Inactive
@joshblack
joshblack temporarily deployed to github-pages December 9, 2022 19:58 — with GitHub Actions Inactive
@github-actions
github-actionsBot temporarily deployed to storybook-preview-2664 December 9, 2022 19:58 Inactive
@joshblackjoshblack mentioned this pull request Dec 13, 2022
22 tasks
@joshblack
joshblack temporarily deployed to github-pages December 15, 2022 18:29 — with GitHub Actions Inactive
@github-actions
github-actionsBottemporarily deployed to storybook-preview-2664 December 15, 2022 18:30 Inactive
@joshblack
joshblack merged commit 1efba24 into ci/add-react-18-testDec 15, 2022
@joshblack
joshblack deleted the feat/update-types-for-react-18 branch December 15, 2022 19:07
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@joshblack@colebemis