@instructure/ui-react-utils
Advanced tools
Comparing version
@@ -6,2 +6,13 @@ # Change Log | ||
## [10.23.1-snapshot-0](https://github.com/instructure/instructure-ui/compare/v10.23.0...v10.23.1-snapshot-0) (2025-07-16) | ||
### Features | ||
* **ui-react-utils:** safeClonElement to support react 19 ([2c9931f](https://github.com/instructure/instructure-ui/commit/2c9931f4c6d815435e6db14e11f6260bb9df91a7)) | ||
# [10.23.0](https://github.com/instructure/instructure-ui/compare/v10.22.0...v10.23.0) (2025-07-09) | ||
@@ -8,0 +19,0 @@ |
@@ -39,3 +39,6 @@ /* | ||
const cloneRef = props.ref; | ||
const originalRef = element.ref; | ||
// Support both React 18 (element.ref) and React 19+ (element.props.ref) | ||
// TypeScript's ReactElement type does not always include a 'ref' property, | ||
// so we use 'as any' to safely access it for React 18 compatibility. | ||
const originalRef = element.props && element.props.ref !== void 0 ? element.props.ref : element.ref; | ||
const originalRefIsAFunction = typeof originalRef === 'function'; | ||
@@ -42,0 +45,0 @@ const cloneRefIsFunction = typeof cloneRef === 'function'; |
@@ -46,3 +46,6 @@ "use strict"; | ||
const cloneRef = props.ref; | ||
const originalRef = element.ref; | ||
// Support both React 18 (element.ref) and React 19+ (element.props.ref) | ||
// TypeScript's ReactElement type does not always include a 'ref' property, | ||
// so we use 'as any' to safely access it for React 18 compatibility. | ||
const originalRef = element.props && element.props.ref !== void 0 ? element.props.ref : element.ref; | ||
const originalRefIsAFunction = typeof originalRef === 'function'; | ||
@@ -49,0 +52,0 @@ const cloneRefIsFunction = typeof cloneRef === 'function'; |
{ | ||
"name": "@instructure/ui-react-utils", | ||
"version": "10.23.0", | ||
"version": "10.23.1-snapshot-0", | ||
"description": "A React utility library made by Instructure Inc.", | ||
@@ -25,3 +25,3 @@ "author": "Instructure, Inc. Engineering and Product Design", | ||
"devDependencies": { | ||
"@instructure/ui-babel-preset": "10.23.0", | ||
"@instructure/ui-babel-preset": "10.23.1-snapshot-0", | ||
"@testing-library/jest-dom": "^6.6.3", | ||
@@ -34,7 +34,7 @@ "@testing-library/react": "^16.0.1", | ||
"@emotion/is-prop-valid": "^1.3.1", | ||
"@instructure/console": "10.23.0", | ||
"@instructure/shared-types": "10.23.0", | ||
"@instructure/ui-decorator": "10.23.0", | ||
"@instructure/ui-dom-utils": "10.23.0", | ||
"@instructure/ui-utils": "10.23.0", | ||
"@instructure/console": "10.23.1-snapshot-0", | ||
"@instructure/shared-types": "10.23.1-snapshot-0", | ||
"@instructure/ui-decorator": "10.23.1-snapshot-0", | ||
"@instructure/ui-dom-utils": "10.23.1-snapshot-0", | ||
"@instructure/ui-utils": "10.23.1-snapshot-0", | ||
"hoist-non-react-statics": "^3.3.2", | ||
@@ -41,0 +41,0 @@ "prop-types": "^15.8.1" |
@@ -63,3 +63,9 @@ /* | ||
const cloneRef = props.ref | ||
const originalRef = element.ref | ||
// Support both React 18 (element.ref) and React 19+ (element.props.ref) | ||
// TypeScript's ReactElement type does not always include a 'ref' property, | ||
// so we use 'as any' to safely access it for React 18 compatibility. | ||
const originalRef = | ||
element.props && element.props.ref !== undefined | ||
? element.props.ref | ||
: (element as any).ref | ||
const originalRefIsAFunction = typeof originalRef === 'function' | ||
@@ -66,0 +72,0 @@ const cloneRefIsFunction = typeof cloneRef === 'function' |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
309193
0.42%4515
0.27%1
Infinity%+ Added
+ Added
+ Added
+ Added
+ Added
- Removed
- Removed
- Removed
- Removed
- Removed