What is the best way to check if a param
is valid
#10156
Unanswered
KirianCaumes
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi 👋
I'm wondering what is the best way to check if a
param
is valid or not.Let's say I have something like this:
This way, with the
loader
, I can verify if myparams.searchid
is valid (with some conditions). And it's seems to work fine.But, as I use Why Did You Render, it shows me that my
Layout
component is re-rendering because of some internaluseContext
fromreact-router
.If I remove the
loader
, it works fine, no more re-rendering.Is there a way avoid thess useless re-rendering? Or do you know a better solution to achieve it?
Thanks 🙏
Beta Was this translation helpful? Give feedback.
All reactions