-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: React 19, types, and bumped testing library things #2621
base: master
Are you sure you want to change the base?
Conversation
You will need to do more changes with the ref typings. See #2612 (comment) |
@MiroslavPetrik if we can get a smaller PR that only changes the types, I'd definitely rather go for that! This repo has very little activity these days :/ |
@@ -9,7 +9,7 @@ export default function usePreviousDistinct<T>( | |||
value: T, | |||
compare: Predicate<T> = strictEquals | |||
): T | undefined { | |||
const prevRef = useRef<T>(); | |||
const prevRef = useRef<T | undefined>(undefined); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The useRef has 1 required parameter now, but there are still the helper overloads for undefined or null, so you don't need to set those explicitly.
const prevRef = useRef<T | undefined>(undefined); | |
const prevRef = useRef<T>(undefined); |
Description
This PR bumps
react
,react-dom
, andreact-test-renderer
to18.3.1
. It also bumps the@testing-library/*
packages to the latest versions. All changes are either comments, types, internal variables, or test file updates.The types are a bit cooked at the moment - not sure how to address this or how it happened. The types are even broken on
master
.Type of change
ensuredForwardRef
's render function has a new type,ForwardRefRenderFunction
, which may cause breaking changes in consumers.Checklist
yarn test
)yarn lint
). Fix it withyarn lint:fix
in case of failure.yarn lint:types
).