Skip to content

Commit 516cd7c

Browse files
committed
Don't memoize filtered messages.
This wasn't interacting well with MobX and messages weren't being updated.
1 parent c18d5ad commit 516cd7c

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

src/modules/analysis/components/Messages.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { useMemo, useState } from 'react';
1+
import { useState } from 'react';
22
import { observer } from 'mobx-react-lite';
33
import { Helmet } from 'react-helmet-async';
44
import styled from 'styled-components';
@@ -56,10 +56,7 @@ export const Messages = observer(
5656
)
5757
)].sort();
5858

59-
const filteredMessages = useMemo(
60-
() => !activeCategory ? messages : messages.filter(m => m.category === activeCategory),
61-
[activeCategory, messages]
62-
);
59+
const filteredMessages = !activeCategory ? messages : messages.filter(m => m.category === activeCategory);
6360

6461
return (
6562
<>

0 commit comments

Comments
 (0)