solid-router icon indicating copy to clipboard operation
solid-router copied to clipboard

`"foo" in useParams()` always evaluates to `false`

Open samualtnorman opened this issue 11 months ago • 0 comments

Describe the bug

"foo" in useParams() // always evaluates to false
"foo" in { ...useParams() } // can evaluate to true or false

I assume this has something to do with useParams() returning a Proxy

Your Example Website or App

https://github.com/samualtnorman/solid-bug/tree/useparams

Steps to Reproduce the Bug or Issue

  1. Clone repo
  2. Switch to useparams branch
  3. pnpm install
  4. pnpm dev
  5. Visit http://localhost:3000/ids/0

Expected behavior

I expect it to evaluate to true when that param is present

Screenshots or Videos

No response

Platform

  • OS: NixOS 24.11 (Vicuna) x86_64
  • Browser: Zen Browser 1.8.2b (Firefox 135.0.1) (64-bit)

Additional context

I initially thought this might have been an issue with Proxys in general in Solid.js but I was only able to replicate the issue with useParams()

samualtnorman avatar Mar 17 '25 15:03 samualtnorman