Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(router): Prevent rerendering authenticated routes on hash change #9007

Merged
merged 4 commits into from
Aug 4, 2023

Conversation

dac09
Copy link
Contributor

@dac09 dac09 commented Aug 4, 2023

  • Fixes rerender
  • Fixes some types

Explanation

We were mutating the wrappers array, when rendering an AuthenticatedRoute. This causes React to re-render the entire page.

WrappedPage now renders an array of wrappers, but doesn't mutate this array (instead creates a new one). React 🤷

@dac09 dac09 added the release:fix This PR is a fix label Aug 4, 2023
@dac09 dac09 requested a review from KrisCoulson August 4, 2023 06:02
Copy link
Contributor

@KrisCoulson KrisCoulson left a comment

Choose a reason for hiding this comment

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

Looks good to me.

@dac09 dac09 added this to the next-release-patch milestone Aug 4, 2023
@dac09 dac09 marked this pull request as draft August 4, 2023 06:16
@dac09 dac09 marked this pull request as ready for review August 4, 2023 06:22
@dac09 dac09 merged commit 0ca221c into redwoodjs:main Aug 4, 2023
@dac09 dac09 deleted the fix/router-rerender-auth-hashchange branch August 4, 2023 07:25
@jtoar jtoar modified the milestones: next-release-patch, v6.0.3 Aug 4, 2023
dac09 added a commit to dac09/redwood that referenced this pull request Aug 8, 2023
* fix/more-streaming-fixes:
  Try injection state isolation
  Also inject before final
  Fix type error
  fix(router): Prevent rerendering authenticated routes on hash change (redwoodjs#9007)
dac09 added a commit to dac09/redwood that referenced this pull request Aug 8, 2023
…nto try/apollo-ssr-stream

* 'fix/more-streaming-fixes' of github.com:dac09/redwood:
  Whoops
  Update packages/vite/src/utils.ts
  More suggestions, fix wrong path on reactRefresh script
  Use node path for consistency
  Fix portal head not rendering on the server
  docs(fonts): Update @font-face recommendation (redwoodjs#8986)
  Docs: remove useless code in code snippet (redwoodjs#8990)
  v6.0.3
  fix(router): Prevent rerendering authenticated routes on hash change (redwoodjs#9007)
  Remove the indexed type reference on AvailableRoutes (redwoodjs#8918)
  Remove debug logs
  Update packages/vite/src/streamHelpers.ts
dac09 added a commit to dac09/redwood that referenced this pull request Aug 9, 2023
…croll-reset

* 'main' of github.com:redwoodjs/redwood:
  fix(deps): update dependency pino to v8.15.0 (redwoodjs#9023)
  fix(deps): update dependency eslint to v8.46.0 (redwoodjs#9022)
  fix(deps): update dependency react-hook-form to v7.45.4 (redwoodjs#9017)
  chore(docs): reversion docs to include recent changes
  fix(deps): update dependency vite to v4.4.9 (redwoodjs#9018)
  v6.0.4
  fix(docs): update quick start to fix Storybook start up (redwoodjs#9014)
  cherry pick part of "fix: Improve GraphQL Schema Validation to allow Subscription types when not using Realtime and ensure schema does not use reserved names (redwoodjs#9005)"
  fix: Improve GraphQL Schema Validation to allow Subscription types when not using Realtime and ensure schema does not use reserved names (redwoodjs#9005)
  Docs: Explain the entry.client.{jsx,tsx} file (redwoodjs#8987)
  chore(deps): update dependency esbuild to v0.18.19 (redwoodjs#8983)
  chore(deps): update dependency nx-cloud to v16.2.0 (redwoodjs#8985)
  docs(fonts): Update @font-face recommendation (redwoodjs#8986)
  Docs: remove useless code in code snippet (redwoodjs#8990)
  v6.0.3
  fix(router): Prevent rerendering authenticated routes on hash change (redwoodjs#9007)
  Remove the indexed type reference on AvailableRoutes (redwoodjs#8918)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release:fix This PR is a fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants