Skip to content

Commit 416c7ca

Browse files
authored
Merge pull request #171 from imagekit-developer/reactv19
React version 19 support
2 parents 5c98ae2 + c9fc8b5 commit 416c7ca

File tree

6 files changed

+11
-38
lines changed

6 files changed

+11
-38
lines changed

.github/workflows/nodejs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ jobs:
8484
tar -cf build.tar --exclude=./build.tar .
8585
- name: Archive build details
8686
if: always()
87-
uses: actions/upload-artifact@v3
87+
uses: actions/upload-artifact@v4
8888
with:
8989
name: e2e-archive
9090
path: build.tar

package-lock.json

Lines changed: 1 addition & 24 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "imagekitio-react",
3-
"version": "4.2.0",
3+
"version": "4.3.0",
44
"description": "React SDK for ImageKit.io which implements client-side upload and URL generation for use inside a react application.",
55
"scripts": {
66
"build:js": "rollup -c",
@@ -67,8 +67,6 @@
6767
"enzyme": "^3.11.0",
6868
"enzyme-adapter-react-16": "^1.15.5",
6969
"jest": "^26.5.2",
70-
"react": "^16.13.1",
71-
"react-dom": "^16.13.1",
7270
"react-test-renderer": "^16.13.1",
7371
"require-context.macro": "^1.2.2",
7472
"rollup": "^2.28.2",
@@ -84,7 +82,7 @@
8482
"prop-types": "^15.7.2"
8583
},
8684
"peerDependencies": {
87-
"react": "^16.13.1 || ^17.0.0 || ^18.0.0",
88-
"react-dom": "^16.13.1 || ^17.0.0 || ^18.0.0"
85+
"react": "^16.13.1 || ^17.0.0 || ^18.0.0 || ^19.0.0",
86+
"react-dom": "^16.13.1 || ^17.0.0 || ^18.0.0 || ^19.0.0"
8987
}
9088
}

src/components/IKImage/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ const IKImage = (props: IKImageProps) => {
9191

9292
return <img
9393
alt={props.alt || ""}
94-
src={currentUrl ? currentUrl : ''}
94+
src={currentUrl ? currentUrl : undefined}
9595
ref={imageRef}
9696
{...restProps}
9797
/>;

src/components/IKVideo/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export type IKVideoState = {
1313
const IKVideo = (props: IKVideoProps & IKContextBaseProps) => {
1414
const videoRef = useRef<HTMLVideoElement>(null);
1515
const [state, setState] = useState<IKVideoState>({
16-
currentUrl: '',
16+
currentUrl: undefined,
1717
contextOptions: {}
1818
});
1919

tests/cypress/integration/IKImage.cy.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ describe('ImageKit React SDK', () => {
22
const APP_HOST = Cypress.env().APP_HOST;
33

44
describe('Lazyload', () => {
5-
it('should have empty src before reaching lazyload threshold', () => {
5+
it('should not have src before reaching lazyload threshold', () => {
66
cy.visit(APP_HOST);
77

8-
cy.get('.lazyload').should('have.attr', 'src').and('equal', '');
8+
cy.get(".lazyload").should("not.have.attr", "src");
99
});
1010

1111
it('should have actual src after reaching lazyload threshold', () => {
@@ -22,12 +22,10 @@ describe('ImageKit React SDK', () => {
2222
});
2323

2424
describe('Lazyload with LQIP', () => {
25-
it('should have lqip src before reaching threshold', () => {
25+
it('should not have lqip src before reaching threshold', () => {
2626
cy.visit(APP_HOST);
2727

28-
cy.get('.lazyload-lqip')
29-
.should('have.attr', 'src')
30-
.and('include', '');
28+
cy.get(".lazyload-lqip").should("not.have.attr", "src");
3129
});
3230

3331
it('should have actual src after reaching element', () => {

0 commit comments

Comments
 (0)