From 79c233e0d445ee81cfa1c8337376f029fde23997 Mon Sep 17 00:00:00 2001 From: Robin Ricard Date: Fri, 8 Jul 2016 11:34:08 +0200 Subject: [PATCH] Get back the oldData in case the query errored It will be empty anyway on the first fetch. But on a force refetch or polling, it won't empty the component from its data while still adding the errors. to it. Fixes #97 --- src/connect.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/connect.tsx b/src/connect.tsx index 83f7ded679..05c118c165 100644 --- a/src/connect.tsx +++ b/src/connect.tsx @@ -347,7 +347,7 @@ export default function connect(opts?: ConnectOptions) { }; let oldData = {}; - const forceRender = ({ errors, data = {} }: any) => { + const forceRender = ({ errors, data = oldData }: any) => { const resultKeyConflict: boolean = ( 'errors' in data || 'loading' in data ||