@pavlo-sobchuk's comments helped me identify the issue and solve it by a simple application of useShallow() like this: const chatMessages = useChatStore(useShallow((state) => state.getMessages(channel?.id)));
useShallow()
const chatMessages = useChatStore(useShallow((state) => state.getMessages(channel?.id)));