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

Simplify with-redux example #8875

Merged
merged 1 commit into from
Oct 1, 2019
Merged

Conversation

HaNdTriX
Copy link
Contributor

@HaNdTriX HaNdTriX commented Sep 27, 2019

Changes

  • Remove _app.js usage
  • Migrate withRedux HOC to functional component
  • Add correct display name to wrapped component
  • Remove abstractions/boilerplate from example
  • Add useInterval HOC from Dan
  • Move Redux Provider to withRedux HOC
  • Update Readme
  • Add withRedux(IndexPage, { ssr: false }) option to allow automatic static optimization

@HaNdTriX HaNdTriX force-pushed the examples/with-redux branch 3 times, most recently from 39b1a66 to 2105439 Compare September 27, 2019 09:46
## Changes

- [x] Remove _app.js usage
- [x] Migrate withRedux HOC to functional component
- [x] Add correct display name
- [x] Remove abstractions/boilerplate from example
- [x] Add useInterval HOC from Dan
Copy link
Member

@lfades lfades left a comment

Choose a reason for hiding this comment

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

@HaNdTriX Thank you 💯

@lfades lfades merged commit b5da739 into vercel:canary Oct 1, 2019
@lww
Copy link

lww commented Oct 6, 2019

@HaNdTriX Awesome, thank you! Could you show how to add redux-persist?

@frnk94
Copy link

frnk94 commented Oct 8, 2019

@lww Why would you want something like Redux-persist ? It defeat the purpose of next. Make your data available to your pages on the server-side rendering rather than caching it in the client browser. Redux-persist will block the rendering of your app until hydratation which will cause the app to render a blank page or the loading state on the server.

If you really need it its quite simple to setup. Let me know and I'll hack something for you. tonight or over the weekend.

@lww
Copy link

lww commented Oct 9, 2019

@frnk94 you are right, I already hacked something together and it is of course blocking the rendering of the page.
So how do I "persist" data over page changes, except for using cookies or query params, or a DB?

@imagine10255
Copy link

Hi, I also need a case to be persistent.

@HaNdTriX HaNdTriX deleted the examples/with-redux branch December 14, 2021 12:30
@vercel vercel locked as resolved and limited conversation to collaborators Jan 27, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants