react-viewport-utils
react-viewport-utils copied to clipboard
feat: add support for null values to support react 19 internal type c…
PR Description:
This update is essential to ensure compatibility with React 19, particularly addressing changes related to ref types. The modification includes the removal of the deprecated type MutableRefObject.
Context:
Under React 18 and earlier versions, the ref type was defined as follows:
const ref = useRef<HTMLDivElement>(null); // type -> React.RefObject<HTMLDivElement>
With React 19, the ref type has been updated to:
const ref = useRef<HTMLDivElement>(null); // type -> React.RefObject<HTMLDivElement | null>
Related Documentation: For more details, refer to the React 19 Upgrade Guide.