You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With the following code I'm getting issues on fragment spreads. I've tried shifting things about a bit but can't work out what the issue is. The code executes fine at runtime.
exportconstMessageSenderAvatar: FC<MessageSenderAvatarProps>=({
messageSenderAvatarRef =null,})=>{constfragmentRef=useFragment(graphql` fragment MessageSenderAvatarFragment on Message { sender { __typename ... on User { ...UserAvatarFragment <--- ISSUE } ... on Bot { ...BotAvatarFragment <--- ISSUE } } } `,messageSenderAvatarRef);if(fragmentRef==null){returnnull;}if(fragmentRef.sender.__typename==='User'){return<UserAvataruserAvatarRef={fragmentRef.sender}/>;}if(fragmentRef.sender.__typename==='Bot'){return<BotAvatarbotAvatarRef={fragmentRef.sender}/>;}return<AnonymousUserAvatar/>;};
and UserAvatar such as
exportconstUserAvatar: FC<UserAvatarProps>=({ userAvatarRef, size =AvatarSize.Size40})=>{const{ avatarUrlTemplate, displayName }=useFragment(graphql` fragment UserAvatarFragment on User { avatarUrlTemplate displayName } `,userAvatarRef);return(<AvatarViewname={displayName}imageUrl={getScaledUrlTemplate(avatarUrlTemplate,size)}size={size}/>);};
The text was updated successfully, but these errors were encountered:
With the following code I'm getting issues on fragment spreads. I've tried shifting things about a bit but can't work out what the issue is. The code executes fine at runtime.
and UserAvatar such as
The text was updated successfully, but these errors were encountered: