mirror of
https://github.com/vector-im/element-call.git
synced 2026-09-22 22:29:30 +00:00
Fix type error
This commit is contained in:
@@ -10,12 +10,15 @@ import { render, screen } from "@testing-library/react";
|
|||||||
import { type FC, useEffect, useState } from "react";
|
import { type FC, useEffect, useState } from "react";
|
||||||
import userEvent from "@testing-library/user-event";
|
import userEvent from "@testing-library/user-event";
|
||||||
|
|
||||||
import { setLocalStorageItem, useLocalStorage } from "./useLocalStorage";
|
import {
|
||||||
|
setLocalStorageItemReactive,
|
||||||
|
useLocalStorage,
|
||||||
|
} from "./useLocalStorage";
|
||||||
|
|
||||||
test("useLocalStorage reacts to changes made by an effect mounted on the same render", () => {
|
test("useLocalStorage reacts to changes made by an effect mounted on the same render", () => {
|
||||||
localStorage.clear();
|
localStorage.clear();
|
||||||
const Test: FC = () => {
|
const Test: FC = () => {
|
||||||
useEffect(() => setLocalStorageItem("my-value", "Hello!"), []);
|
useEffect(() => setLocalStorageItemReactive("my-value", "Hello!"), []);
|
||||||
const [myValue] = useLocalStorage("my-value");
|
const [myValue] = useLocalStorage("my-value");
|
||||||
return myValue;
|
return myValue;
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user