Skip to content

Conversation

@HagerDakroury
Copy link

@HagerDakroury HagerDakroury commented Apr 8, 2024

Package(s) involved

@amazeelabs/bridge-gatsby

Description of changes

  • 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

Some resources:

Related Issue(s)

How has this been tested?

Manually with a new frontend project with SLB as a starter

@HagerDakroury HagerDakroury requested a review from pmelab April 9, 2024 08:16

export const useLocation: useLocationType = () => {
const location = gatsbyUseLocation();
const [updatedSearch, setUpdatedSearch] = React.useState('');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the search enough? What about the query fragment, can we test if that works correctly?
Otherwise we maybe should store the whole url object in the state?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants