Added a state that get updated whenever the search params are defined, in order to trigger a render on the client
Motivation and context
A common bug on PAR that got partially fixed when using react-hook-form but wasn't completely solved expect by doing a Two pass render similar to the one implemented here. The issue is also reproducible in a new project using SLB. More on PAR issue
Package(s) involved
@amazeelabs/bridge-gatsby
Description of changes
Motivation and context
A common bug on
PAR
that got partially fixed when usingreact-hook-form
but wasn't completely solved expect by doing a Two pass render similar to the one implemented here. The issue is also reproducible in a new project using SLB. More on PAR issueSome resources:
hydration
in GatsbyRelated Issue(s)
How has this been tested?
Manually with a new frontend project with SLB as a starter
Before -> https://splendorous-kataifi-fda428.netlify.app/?id=2
useLocation
directlyreact-hook-form
. First and third field usingregister
, second field usingwatch
(not updated, same withgetValues
)After -> https://celebrated-sunflower-c2587c.netlify.app/?id=2