Fiddle: update to latest ui-react#14
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the @kibalabs/ui-react devDependency from version 0.11.3-next.18 to 0.11.3-next.22, requiring a code change to explicitly handle the ref property on the input element. This update aligns with the changelog's note about updating to work with ui-react v0.11.3 and above for CSS-based theming.
Key changes:
- Updated
@kibalabs/ui-reactdevDependency to version0.11.3-next.22with caret versioning - Added explicit ref handling to the input element in the Dropzone component
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| package.json | Updates @kibalabs/ui-react devDependency to ^0.11.3-next.22, changing from pinned to caret versioning |
| package-lock.json | Reflects the updated package version with new integrity hash |
| src/component.tsx | Adds explicit ref property to input element with type assertion to support the updated ui-react version |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| "devDependencies": { | ||
| "@kibalabs/build": "0.13.3-next.13", | ||
| "@kibalabs/ui-react": "0.11.3-next.18", | ||
| "@kibalabs/ui-react": "^0.11.3-next.22", |
There was a problem hiding this comment.
The version specifier has been changed from a pinned version 0.11.3-next.18 to a caret range ^0.11.3-next.22. This changes the versioning strategy for this devDependency.
For pre-release versions (versions with -next), npm's caret behavior might not work as expected. The caret (^) allows updates that do not modify the left-most non-zero element, but with pre-release identifiers, the behavior can be unpredictable. Consider whether you want to:
- Keep it pinned (remove the
^) for consistent builds - Use a tilde (
~) to allow only patch-level changes - Keep the caret if flexible pre-release updates are intentional
This change should also be reflected in the peerDependencies constraint on line 49, which currently specifies >=0.11.3-next.18.
| style={style} | ||
| > | ||
| <input | ||
| ref={(inputProps as React.InputHTMLAttributes<HTMLInputElement> & { ref?: React.Ref<HTMLInputElement> }).ref} |
There was a problem hiding this comment.
The type assertion on line 53 is overly complex and could be simplified. Since getInputProps() from react-dropzone returns props that include a ref property, you can simply use inputProps.ref directly without the type assertion. The current casting to React.InputHTMLAttributes<HTMLInputElement> & { ref?: React.Ref<HTMLInputElement> } is unnecessarily verbose and may cause type safety issues.
Consider simplifying to:
ref={inputProps.ref}This is the standard pattern for react-dropzone and will work correctly with TypeScript.
| ref={(inputProps as React.InputHTMLAttributes<HTMLInputElement> & { ref?: React.Ref<HTMLInputElement> }).ref} | |
| ref={inputProps.ref} |
Description
Screenshots:
Checklist: