From be98c01d5882e9fc8507af907abc6cf18876933f Mon Sep 17 00:00:00 2001 From: Anurag Hazra Date: Wed, 8 Apr 2020 20:32:42 +0530 Subject: [PATCH] chore(docs): typescript optional chaining instead of && I think this is more readable. --- docs/source/tutorial/queries.mdx | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/docs/source/tutorial/queries.mdx b/docs/source/tutorial/queries.mdx index 39d688027..509e66682 100644 --- a/docs/source/tutorial/queries.mdx +++ b/docs/source/tutorial/queries.mdx @@ -85,9 +85,7 @@ const Launches: React.FC = () => { return (
- {data.launches && - data.launches.launches && - data.launches.launches.map((launch: any) => ( + {data?.launches?.launches?.map((launch: any) => ( ))} @@ -137,8 +135,7 @@ Copy the code below and add it before the closing `` tag in the `Laun ```tsx:title=src/pages/launches.tsx -{data.launches && - data.launches.hasMore && ( +{data?.launches?.hasMore && (