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

Commit 5f1fb12

Browse files
committed
Update to React 18
1 parent c61e641 commit 5f1fb12

8 files changed

+11
-16
lines changed

package.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@
7171
"@matrix-org/matrix-wysiwyg": "2.17.0",
7272
"@matrix-org/react-sdk-module-api": "^2.4.0",
7373
"@sentry/browser": "^7.0.0",
74-
"@testing-library/react-hooks": "^8.0.1",
7574
"await-lock": "^2.1.0",
7675
"blurhash": "^2.0.3",
7776
"classnames": "^2.2.6",
@@ -107,10 +106,10 @@
107106
"posthog-js": "1.126.0",
108107
"qrcode": "1.5.3",
109108
"re-resizable": "^6.9.0",
110-
"react": "17.0.2",
109+
"react": "^18.2.0",
111110
"react-beautiful-dnd": "^13.1.0",
112111
"react-blurhash": "^0.3.0",
113-
"react-dom": "17.0.2",
112+
"react-dom": "^18.2.0",
114113
"react-focus-lock": "^2.5.1",
115114
"react-transition-group": "^4.4.1",
116115
"rfc4648": "^1.4.0",
@@ -152,7 +151,7 @@
152151
"@casualbot/jest-sonar-reporter": "2.2.7",
153152
"@peculiar/webcrypto": "^1.4.3",
154153
"@testing-library/jest-dom": "^6.0.0",
155-
"@testing-library/react": "^12.1.5",
154+
"@testing-library/react": "^14",
156155
"@testing-library/user-event": "^14.4.3",
157156
"@types/commonmark": "^0.27.4",
158157
"@types/counterpart": "^0.18.1",

test/hooks/useDebouncedCallback-test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
1616

17-
import { renderHook } from "@testing-library/react-hooks";
17+
import { renderHook } from "@testing-library/react";
1818

1919
import { useDebouncedCallback } from "../../src/hooks/spotlight/useDebouncedCallback";
2020

test/hooks/useLatestResult-test.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
1616

17-
import { renderHook, RenderHookResult } from "@testing-library/react-hooks/dom";
17+
import { renderHook, RenderHookResult } from "@testing-library/react";
1818

1919
import { useLatestResult } from "../../src/hooks/useLatestResult";
2020

@@ -28,7 +28,7 @@ beforeEach(() => {
2828
});
2929

3030
function simulateRequest(
31-
hookResult: RenderHookResult<typeof useLatestResult, ReturnType<typeof useLatestResult>>["result"],
31+
hookResult: RenderHookResult<ReturnType<typeof useLatestResult>, typeof useLatestResult>["result"],
3232
{ id, delayInMs, result }: { id: string; delayInMs: number; result: string },
3333
) {
3434
const [setQuery, setResult] = hookResult.current;

test/hooks/useProfileInfo-test.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@ See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
1616

17-
import { waitFor } from "@testing-library/react";
18-
import { renderHook, act } from "@testing-library/react-hooks/dom";
17+
import { waitFor, renderHook, act } from "@testing-library/react";
1918
import { MatrixClient } from "matrix-js-sdk/src/matrix";
2019

2120
import { useProfileInfo } from "../../src/hooks/useProfileInfo";

test/hooks/usePublicRoomDirectory-test.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@ See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
1616

17-
import { waitFor } from "@testing-library/react";
18-
import { renderHook, act } from "@testing-library/react-hooks/dom";
17+
import { waitFor, renderHook, act } from "@testing-library/react";
1918
import { IRoomDirectoryOptions, MatrixClient } from "matrix-js-sdk/src/matrix";
2019

2120
import { usePublicRoomDirectory } from "../../src/hooks/usePublicRoomDirectory";

test/hooks/useSlidingSyncRoomSearch-test.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@ See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
1616

17-
import { waitFor } from "@testing-library/react";
18-
import { renderHook, act } from "@testing-library/react-hooks/dom";
17+
import { waitFor, renderHook, act } from "@testing-library/react";
1918
import { mocked } from "jest-mock";
2019
import { SlidingSync } from "matrix-js-sdk/src/sliding-sync";
2120
import { Room } from "matrix-js-sdk/src/matrix";

test/hooks/useUserDirectory-test.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@ See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
1616

17-
import { waitFor } from "@testing-library/react";
18-
import { renderHook, act } from "@testing-library/react-hooks/dom";
17+
import { waitFor, renderHook, act } from "@testing-library/react";
1918
import { MatrixClient } from "matrix-js-sdk/src/matrix";
2019

2120
import { useUserDirectory } from "../../src/hooks/useUserDirectory";

test/hooks/useUserOnboardingTasks-test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
1616

17-
import { renderHook } from "@testing-library/react-hooks";
17+
import { renderHook } from "@testing-library/react";
1818

1919
import { useUserOnboardingTasks } from "../../src/hooks/useUserOnboardingTasks";
2020

0 commit comments

Comments
 (0)