Skip to content
This repository was archived by the owner on Dec 5, 2024. It is now read-only.

Commit f5363f8

Browse files
committed
fix: more react-18 fixes
1 parent 260ca70 commit f5363f8

File tree

5 files changed

+34
-31
lines changed

5 files changed

+34
-31
lines changed

.github/workflows/tests.yml

+3-6
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@ jobs:
1010
runs-on: ubuntu-latest
1111
steps:
1212
- uses: actions/checkout@v2
13-
- uses: CultureHQ/actions-yarn@master
14-
with:
15-
args: install
16-
- uses: CultureHQ/actions-yarn@master
17-
with:
18-
args: test
13+
- uses: actions/setup-node@v2
14+
- run: yarn install
15+
- run: yarn test

package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -94,16 +94,16 @@
9494
"eslint-plugin-promise": "^4.2.1",
9595
"eslint-plugin-react": "^7.19.0",
9696
"eslint-plugin-react-hooks": "^3.0.0",
97-
"flow-bin": "^0.147.0",
97+
"flow-bin": "^0.176.2",
9898
"flow-copy-source": "^2.0.9",
9999
"gh-pages": "^2.2.0",
100100
"git-branch-is": "^3.1.0",
101101
"jest": "^25.2.4",
102102
"parcel-bundler": "^1.12.4",
103103
"prettier": "^2.0.2",
104104
"pretty-quick": "^2.0.1",
105-
"react": "17.0.0",
106-
"react-dom": "^17.0.0",
105+
"react": "18.0.0",
106+
"react-dom": "^18.0.0",
107107
"react-spring": "^8.0.27",
108108
"react-test-renderer": "^17.0.0",
109109
"rimraf": "^3.0.2",

src/Reference.js

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ export function Reference({ children, innerRef }: ReferenceProps): React.Node {
2323
);
2424

2525
// ran on unmount
26+
// eslint-disable-next-line react-hooks/exhaustive-deps
2627
React.useEffect(() => () => setRef(innerRef, null), []);
2728

2829
React.useEffect(() => {

src/usePopper.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// @flow strict
22
import * as React from 'react';
3-
import { flushSync } from 'react-dom';
3+
import * as ReactDOM from 'react-dom';
44
import {
55
createPopper as defaultCreatePopper,
66
type Options as PopperOptions,
@@ -75,13 +75,13 @@ export const usePopper = (
7575
fn: ({ state }) => {
7676
const elements = Object.keys(state.elements);
7777

78-
flushSync(() => {
78+
ReactDOM.flushSync(() => {
7979
setState({
8080
styles: fromEntries(
81-
elements.map(element => [element, state.styles[element] || {}])
81+
elements.map((element) => [element, state.styles[element] || {}])
8282
),
8383
attributes: fromEntries(
84-
elements.map(element => [element, state.attributes[element]])
84+
elements.map((element) => [element, state.attributes[element]])
8585
),
8686
});
8787
});

yarn.lock

+23-18
Original file line numberDiff line numberDiff line change
@@ -2212,9 +2212,9 @@ caniuse-api@^3.0.0:
22122212
lodash.uniq "^4.5.0"
22132213

22142214
caniuse-lite@^1.0.0, caniuse-lite@^1.0.30001038:
2215-
version "1.0.30001040"
2216-
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001040.tgz#103fc8e6eb1d7397e95134cd0e996743353d58ea"
2217-
integrity sha512-Ep0tEPeI5wCvmJNrXjE3etgfI+lkl1fTDU6Y3ZH1mhrjkPlVI9W4pcKbMo+BQLpEWKVYYp2EmYaRsqpPC3k7lQ==
2215+
version "1.0.30001332"
2216+
resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001332.tgz"
2217+
integrity sha512-10T30NYOEQtN6C11YGg411yebhvpnC6Z102+B95eAsN0oB6KUs01ivE8u+G6FMIRtIrVlYXhL+LUwQ3/hXwDWw==
22182218

22192219
capture-exit@^2.0.0:
22202220
version "2.0.0"
@@ -3648,10 +3648,10 @@ flatted@^2.0.0:
36483648
resolved "https://registry.yarnpkg.com/flatted/-/flatted-2.0.2.tgz#4575b21e2bcee7434aa9be662f4b7b5f9c2b5138"
36493649
integrity sha512-r5wGx7YeOwNWNlCA0wQ86zKyDLMQr+/RB8xy74M4hTphfmjlijTSSXGuH8rnvKZnfT9i+75zmd8jcKdMR4O6jA==
36503650

3651-
flow-bin@^0.147.0:
3652-
version "0.147.0"
3653-
resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.147.0.tgz#5ac0152e6daabfa8a78950aa1d02aefa968c4300"
3654-
integrity sha512-4VwnpQGxFQHRo2AvWcHbVOD6wLunT8Tge/cZGSv9twAxLMGSOTop7KDToZI6M/yoGBzdHxQWBii426LupWlbog==
3651+
flow-bin@^0.176.2:
3652+
version "0.176.2"
3653+
resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.176.2.tgz#b257da3ebd131b368c95c72e010dc823bfa159e8"
3654+
integrity sha512-gX3YJvv40oRY7A/ytEsWLDMHTfIkmy6ir1D4e5fklVsj3958iTg90cO8XwDdspnxQSgEUP1HW1e6wlX1OlQ5+Q==
36553655

36563656
flow-copy-source@^2.0.9:
36573657
version "2.0.9"
@@ -6621,14 +6621,13 @@ range-parser@~1.2.1:
66216621
resolved "https://registry.yarnpkg.com/range-parser/-/range-parser-1.2.1.tgz#3cf37023d199e1c24d1a55b84800c2f3e6468031"
66226622
integrity sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==
66236623

6624-
react-dom@^17.0.0:
6625-
version "17.0.0"
6626-
resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-17.0.0.tgz#f8266e4d9861584553ccbd186d596a1c7dd8dcb4"
6627-
integrity sha512-OGnFbxCjI2TMAZYMVxi4hqheJiN8rCEVVrL7XIGzCB6beNc4Am8M47HtkvxODZw9QgjmAPKpLba9FTu4fC1byA==
6624+
react-dom@^18.0.0:
6625+
version "18.0.0"
6626+
resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-18.0.0.tgz#26b88534f8f1dbb80853e1eabe752f24100d8023"
6627+
integrity sha512-XqX7uzmFo0pUceWFCt7Gff6IyIMzFUn7QMZrbrQfGxtaxXZIcGQzoNpRLE3fQLnS4XzLLPMZX2T9TRcSrasicw==
66286628
dependencies:
66296629
loose-envify "^1.1.0"
6630-
object-assign "^4.1.1"
6631-
scheduler "^0.20.0"
6630+
scheduler "^0.21.0"
66326631

66336632
react-fast-compare@^3.0.1:
66346633
version "3.0.1"
@@ -6671,13 +6670,12 @@ react-test-renderer@^17.0.0:
66716670
react-shallow-renderer "^16.13.1"
66726671
scheduler "^0.20.0"
66736672

6674-
react@17.0.0:
6675-
version "17.0.0"
6676-
resolved "https://registry.yarnpkg.com/react/-/react-17.0.0.tgz#ad96d5fa1a33bb9b06d0cc52672f7992d84aa662"
6677-
integrity sha512-rG9bqS3LMuetoSUKHN8G3fMNuQOePKDThK6+2yXFWtoeTDLVNh/QCaxT+Jr+rNf4lwNXpx+atdn3Aa0oi8/6eQ==
6673+
react@18.0.0:
6674+
version "18.0.0"
6675+
resolved "https://registry.yarnpkg.com/react/-/react-18.0.0.tgz#b468736d1f4a5891f38585ba8e8fb29f91c3cb96"
6676+
integrity sha512-x+VL6wbT4JRVPm7EGxXhZ8w8LTROaxPXOqhlGyVSrv0sB1jkyFGgXxJ8LVoPRLvPR6/CIZGFmfzqUa2NYeMr2A==
66786677
dependencies:
66796678
loose-envify "^1.1.0"
6680-
object-assign "^4.1.1"
66816679

66826680
readable-stream@^2.0.2, readable-stream@^2.2.2, readable-stream@^2.3.3, readable-stream@^2.3.6, readable-stream@~2.3.3, readable-stream@~2.3.6:
66836681
version "2.3.7"
@@ -7072,6 +7070,13 @@ scheduler@^0.20.0:
70727070
loose-envify "^1.1.0"
70737071
object-assign "^4.1.1"
70747072

7073+
scheduler@^0.21.0:
7074+
version "0.21.0"
7075+
resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.21.0.tgz#6fd2532ff5a6d877b6edb12f00d8ab7e8f308820"
7076+
integrity sha512-1r87x5fz9MXqswA2ERLo0EbOAU74DpIUO090gIasYTqlVoJeMcl+Z1Rg7WHz+qtPujhS/hGIt9kxZOYBV3faRQ==
7077+
dependencies:
7078+
loose-envify "^1.1.0"
7079+
70757080
70767081
version "7.0.0"
70777082
resolved "https://registry.yarnpkg.com/semver/-/semver-7.0.0.tgz#5f3ca35761e47e05b206c6daff2cf814f0316b8e"

0 commit comments

Comments
 (0)