diff --git a/src/Query.re b/src/Query.re index 3ce20b6..a0595e6 100644 --- a/src/Query.re +++ b/src/Query.re @@ -145,14 +145,18 @@ module Make = (Config: Config) => { [|jsResult|], ); - ( - switch (result) { - | {loading: true} => Loading - | {error: Some(error)} => Error(error) - | {data: Some(data)} => Data(data) - | _ => NoData - }, - result, - ); + let simple = + React.useMemo1( + () => + switch (result) { + | {loading: true} => Loading + | {error: Some(error)} => Error(error) + | {data: Some(data)} => Data(data) + | _ => NoData + }, + [|result|], + ); + + (simple, result); }; -}; \ No newline at end of file +};