Skip to content

Commit

Permalink
Merge pull request #38 from Ayc0/Ayc0/react-18
Browse files Browse the repository at this point in the history
React 18 **BREAKING CHANGE**
  • Loading branch information
Ayc0 authored Jul 30, 2023
2 parents 55599c7 + d7f3f5a commit 063a6dc
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 26 deletions.
6 changes: 1 addition & 5 deletions packages/react-manatea/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,15 @@
"build:action": "microbundle --name $npm_package_name --globals react=React",
"build": "yarn build:clean && yarn build:action"
},
"dependencies": {
"use-sync-external-store": "^1.2.0"
},
"devDependencies": {
"@types/react": "^18.2.17",
"@types/use-sync-external-store": "^0.0.3",
"microbundle": "^0.15.1",
"react": "^18.2.0",
"react-test-renderer": "^18.2.0",
"typescript": "^5.1.6"
},
"peerDependencies": {
"manatea": "workspace:*",
"react": ">=16.8.2"
"react": ">=18.0.0"
}
}
5 changes: 3 additions & 2 deletions packages/react-manatea/src/useInfuser.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import * as React from 'react';
import { Cup, Tea, Waiter, Context } from 'manatea';
import { useSyncExternalStore } from 'use-sync-external-store/shim';

export const useInfuser = <
FlavoredTea extends Tea,
Expand All @@ -15,7 +14,9 @@ export const useInfuser = <
};
}, [cup]);

const flavoredTea = useSyncExternalStore<FlavoredTea>(subscribe, () => cup());
const flavoredTea = React.useSyncExternalStore<FlavoredTea>(subscribe, () =>
cup(),
);

return [
flavoredTea,
Expand Down
20 changes: 1 addition & 19 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2088,13 +2088,6 @@ __metadata:
languageName: node
linkType: hard

"@types/use-sync-external-store@npm:^0.0.3":
version: 0.0.3
resolution: "@types/use-sync-external-store@npm:0.0.3"
checksum: 161ddb8eec5dbe7279ac971531217e9af6b99f7783213566d2b502e2e2378ea19cf5e5ea4595039d730aa79d3d35c6567d48599f69773a02ffcff1776ec2a44e
languageName: node
linkType: hard

"@types/yargs-parser@npm:*":
version: 21.0.0
resolution: "@types/yargs-parser@npm:21.0.0"
Expand Down Expand Up @@ -5994,15 +5987,13 @@ __metadata:
resolution: "react-manatea@workspace:packages/react-manatea"
dependencies:
"@types/react": ^18.2.17
"@types/use-sync-external-store": ^0.0.3
microbundle: ^0.15.1
react: ^18.2.0
react-test-renderer: ^18.2.0
typescript: ^5.1.6
use-sync-external-store: ^1.2.0
peerDependencies:
manatea: "workspace:*"
react: ">=16.8.2"
react: ">=18.0.0"
languageName: unknown
linkType: soft

Expand Down Expand Up @@ -7021,15 +7012,6 @@ __metadata:
languageName: node
linkType: hard

"use-sync-external-store@npm:^1.2.0":
version: 1.2.0
resolution: "use-sync-external-store@npm:1.2.0"
peerDependencies:
react: ^16.8.0 || ^17.0.0 || ^18.0.0
checksum: 5c639e0f8da3521d605f59ce5be9e094ca772bd44a4ce7322b055a6f58eeed8dda3c94cabd90c7a41fb6fa852210092008afe48f7038792fd47501f33299116a
languageName: node
linkType: hard

"util-deprecate@npm:^1.0.1, util-deprecate@npm:^1.0.2":
version: 1.0.2
resolution: "util-deprecate@npm:1.0.2"
Expand Down

0 comments on commit 063a6dc

Please sign in to comment.