diff --git a/packages/react/src/components/PinnedMessages/PinnedMessages.js b/packages/react/src/components/PinnedMessages/PinnedMessages.js index f86d70730..557cc9602 100644 --- a/packages/react/src/components/PinnedMessages/PinnedMessages.js +++ b/packages/react/src/components/PinnedMessages/PinnedMessages.js @@ -23,7 +23,7 @@ const PinnedMessages = () => { setLoading(false); }; getPinnedMessages(); - }); + }, [RCInstance, setMessageList, setLoading]); const isMessageNewDay = (current, previous) => !previous || !isSameDay(new Date(current.ts), new Date(previous.ts)); diff --git a/packages/react/src/components/StarredMessages/StarredMessages.js b/packages/react/src/components/StarredMessages/StarredMessages.js index 8bda57556..eb2475f62 100644 --- a/packages/react/src/components/StarredMessages/StarredMessages.js +++ b/packages/react/src/components/StarredMessages/StarredMessages.js @@ -15,17 +15,17 @@ const StarredMessages = () => { (state) => state.setShowStarred ); - const [messageList, setmessageList] = useState([]); + const [messageList, setMessageList] = useState([]); const [loading, setLoading] = useState(true); useEffect(() => { const getStarredMessages = async () => { const { messages } = await RCInstance.getStarredMessages(); - setmessageList(messages); + setMessageList(messages); setLoading(false); }; getStarredMessages(); - }); + }, [RCInstance, setMessageList, setLoading]); const isMessageNewDay = (current, previous) => !previous || !isSameDay(new Date(current.ts), new Date(previous.ts));