title: Trying to return multiple values from react functional component method
body: <p>I am trying to return a multiple values from the below method and getting an error like property assignment expected at the <code>return</code> statement and my method looks like this below,</p>
  
  <pre><code>export const useSectionQuery = (query, resultFieldName, updateState, transform, initialRevisionId) =&gt; {
  
    const [completed, setCompleted] = useState(false);
    let  transformed;
    const { loading, error } = useQuery(query, {
      variables: {
        where: initialRevisionId ? { initialRevisionId } : { isApproved: true },
        order_by: null
      },
      fetchPolicy: 'network-only',
      onCompleted: data =&gt; {
       transformed = transform ? transform(data[resultFieldName]) : data[resultFieldName];
        updateState(draft =&gt; {
          draft[resultFieldName] = transformed;
        });
        setCompleted(true);
      }
    });
    if (error) return errorRedirectElement(error, resultFieldName);
    return {(!completed || loading) &amp;&amp; loadingElement, transformed };
  };
  </code></pre>
  
  <p>and getting an error <code>property assignment is expected</code> at here in below line </p>
  
  <pre><code> return {(!completed || loading) &amp;&amp; loadingElement, transformed }
  </code></pre>