dezzerlol / insta-clone

Found template literal expression having a non-string type JS-0378
Anti-pattern
Minor
a year agoa year old
Invalid type "string | null" of template literal expression
50                    <Avatar size='lg' radius='xl' src={s.avatar ? s.avatar : ''} />
51                  </Anchor>
52                </Link>
53                <Link href={`/${s.name}`} passHref>54                  <Anchor mt='1rem' underline={false} color='dark'>
55                    {s.name}
56                  </Anchor>
Invalid type "string | null" of template literal expression
45                  border: '1px solid lightgray',
46                  borderRadius: '5px',
47                }}>
48                <Link href={`/${s.name}`} passHref>49                  <Anchor>
50                    <Avatar size='lg' radius='xl' src={s.avatar ? s.avatar : ''} />
51                  </Anchor>
Invalid type "string | null | undefined" of template literal expression
20    async onSuccess() {
21      if (type === 'profile') {
22        await utils.invalidateQueries('user.get-profile')
23        router.push(`/${name}`, undefined, { shallow: true })24      } else if (type === 'feed') {
25        await utils.invalidateQueries('feed.get-feed')
26      }
Invalid type "string | null | undefined" of template literal expression
11const AvatarName = ({ avatar, name, undername }: Props) => {
12  return (
13    <Box sx={{ display: 'flex', alignItems: 'center' }}>
14      <Link href={`/${name}`} passHref>15        <Anchor>
16          {avatar ? (
17            <Avatar radius='xl' src={avatar === '0' ? null : avatar} alt={name!} />
Invalid type "string | null | undefined" of template literal expression
 45          </Box>
 46          {mobileQuery && (
 47            <Box>
 48              <ActionIcon onClick={() => router.push(`/${name}`, undefined, { shallow: true })}> 49                <MdClose size={30} />
 50              </ActionIcon>
 51            </Box>