Fix: Should use observer not observable.

This commit is contained in:
Paul 2021-07-29 16:08:35 +01:00
parent f8611ddea5
commit 748713be53
2 changed files with 4 additions and 2 deletions

View file

@ -1,6 +1,7 @@
import { At, Hash, Menu } from "@styled-icons/boxicons-regular"; import { At, Hash, Menu } from "@styled-icons/boxicons-regular";
import { Notepad, Group } from "@styled-icons/boxicons-solid"; import { Notepad, Group } from "@styled-icons/boxicons-solid";
import { observable } from "mobx"; import { observable } from "mobx";
import { observer } from "mobx-react-lite";
import { Channel } from "revolt.js"; import { Channel } from "revolt.js";
import styled from "styled-components"; import styled from "styled-components";
@ -69,7 +70,7 @@ const Info = styled.div`
} }
`; `;
export default observable(({ channel, toggleSidebar }: ChannelHeaderProps) => { export default observer(({ channel, toggleSidebar }: ChannelHeaderProps) => {
const { openScreen } = useIntermediate(); const { openScreen } = useIntermediate();
const client = useClient(); const client = useClient();
const state = useData(); const state = useData();

View file

@ -1,5 +1,6 @@
import { BarChart } from "@styled-icons/boxicons-regular"; import { BarChart } from "@styled-icons/boxicons-regular";
import { observable } from "mobx"; import { observable } from "mobx";
import { observer } from "mobx-react-lite";
import styled from "styled-components"; import styled from "styled-components";
import { Text } from "preact-i18n"; import { Text } from "preact-i18n";
@ -69,7 +70,7 @@ const VoiceBase = styled.div`
} }
`; `;
export default observable(({ id }: Props) => { export default observer(({ id }: Props) => {
const { status, participants, roomId } = useContext(VoiceContext); const { status, participants, roomId } = useContext(VoiceContext);
if (roomId !== id) return null; if (roomId !== id) return null;