tmdb-explorer icon indicating copy to clipboard operation
tmdb-explorer copied to clipboard

Resolve AppDrawerItem's href to suppress prop type warning

Open dlh3 opened this issue 1 year ago • 1 comments

I was getting a prop type warning for the genre links in the app drawer. It seemed to be working totally fine, but I wanted to suppress the error.

image

This may not be the best solution, but it's a solution. Use the Router to resolve the href from a URL object.

dlh3 avatar Apr 18 '24 03:04 dlh3

@dlh3 is attempting to deploy a commit to the Onur Onder's projects Team on Vercel.

A member of the Team first needs to authorize it.

vercel[bot] avatar Apr 18 '24 03:04 vercel[bot]

Firstly, thanks for this PR 🙏

Using and internal function like next/dist/shared/lib/router/utils/resolve-href seems more dangerous to me when I compare it to having a prop-types warning. AFAICS code works currently without a problem, but it shows prop-types warning anyway.

I mostly believe using public APIs of frameworks/libraries are better instead of satisfying (false positive maybe 🤔) warnings.

Anyway, huge thanks again for your efforts 🙇

onderonur avatar Oct 09 '24 21:10 onderonur

@onderonur no worries, totally agree.

Thoughts on a better way to satisfy the warning? Perhaps a type-hint or coercion?

dlh3 avatar Oct 09 '24 22:10 dlh3