Skip to content

Commit

Permalink
fix: remove error throwing as first render does not have href props r…
Browse files Browse the repository at this point in the history
…eady
  • Loading branch information
tomiir committed Jul 2, 2024
1 parent dac8cec commit c7d38d4
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions apps/laboratory/src/components/RandomLink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ export function RandomLink({ hrefs, children }: { hrefs: string[]; children: Rea
const [href, setHref] = useState<string>()
useEffect(() => {
const newHref = hrefs[Math.floor(Math.random() * hrefs.length)]
if (!href) {
throw new Error('No hrefs provided')
}
setHref(newHref)
}, [hrefs])

Expand Down

0 comments on commit c7d38d4

Please sign in to comment.