Skip to content

Commit

Permalink
fix(react-image): support under react 18 (#57)
Browse files Browse the repository at this point in the history
## Summary

We need to support react 16, 17 too. because we defined react 16, 17,
not only 18 as peerDependencies
```json
"react": "^16.8 || ^17 || ^18"
```

Please check the following:

- [x] I have written documents and tests, if needed.
  • Loading branch information
manudeli authored Sep 29, 2023
1 parent fe3581e commit ab37603
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 6 deletions.
5 changes: 5 additions & 0 deletions .changeset/selfish-pears-act.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@fepack/react-image": patch
---

fix(react-image): support under react 18
4 changes: 3 additions & 1 deletion packages/react-image/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@
"type:check": "tsc --noEmit"
},
"dependencies": {
"@fepack/image": "workspace:0.2.4"
"@fepack/image": "workspace:0.2.4",
"use-sync-external-store": "^1.2.0"
},
"devDependencies": {
"@testing-library/jest-dom": "^5.16.5",
Expand All @@ -56,6 +57,7 @@
"@types/react": "^18.2.0",
"@types/react-dom": "^18.2.1",
"@types/testing-library__jest-dom": "^5.14.5",
"@types/use-sync-external-store": "^0.0.4",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
Expand Down
7 changes: 2 additions & 5 deletions packages/react-image/src/Load.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
import { LoadClient, type LoadSrc, type LoadState } from "@fepack/image";
import {
type FunctionComponent,
createElement,
useSyncExternalStore,
} from "react";
import { type FunctionComponent, createElement } from "react";
import { useSyncExternalStore } from "use-sync-external-store/shim";

const loadClient = new LoadClient();

Expand Down
18 changes: 18 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit ab37603

Please sign in to comment.