All Projects β†’ joaopaulomoraes β†’ Nextjs With Redux And Material Ui

joaopaulomoraes / Nextjs With Redux And Material Ui

A boilerplate NextJS with Redux and Material UI

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Nextjs With Redux And Material Ui

Nitro
An Example of a PWA using Nextjs, Material-UI, Typescript and Auth0 πŸ’—
Stars: ✭ 130 (+64.56%)
Mutual labels:  nextjs, material-ui
Nextjs Full Demo
Demo about integration between examples of next.js and also fix some issues during development
Stars: ✭ 76 (-3.8%)
Mutual labels:  nextjs, material-ui
Nextjs Material Kit
NextJS version of Material Kit React by Creative Tim
Stars: ✭ 141 (+78.48%)
Mutual labels:  nextjs, material-ui
Typescript Nextjs Redux Material Ui Example
next.js v9, typescript v3.7, redux, material-ui v4, react-hooks, redux-saga, SSR
Stars: ✭ 93 (+17.72%)
Mutual labels:  nextjs, material-ui
Material Kit React
React Dashboard made with Material UI’s components. Our pro template contains features like TypeScript version, authentication system with Firebase and Auth0 plus many other
Stars: ✭ 3,465 (+4286.08%)
Mutual labels:  material-ui, nextjs
Saas
Build your own SaaS business with SaaS boilerplate. Productive stack: React, Material-UI, Next, MobX, WebSockets, Express, Node, Mongoose, MongoDB. Written with TypeScript.
Stars: ✭ 2,720 (+3343.04%)
Mutual labels:  nextjs, material-ui
Ark
An easiest authentication system on top of NestJS, TypeORM, NEXT.js(v9.3) and Material UI(v4).
Stars: ✭ 228 (+188.61%)
Mutual labels:  nextjs, material-ui
Builderbook
Open source web application to learn JS stack: React, Material-UI, Next.js, Node.js, Express.js, Mongoose, MongoDB database.
Stars: ✭ 3,015 (+3716.46%)
Mutual labels:  nextjs, material-ui
react-movies-finder
React Movies finder is a React app to search movies and series using redux, redux-thunk, React Hooks, and Material UI
Stars: ✭ 27 (-65.82%)
Mutual labels:  nextjs, material-ui
netease-music-app
η½‘ζ˜“δΊ‘ιŸ³δΉη§»εŠ¨η«―γ€React/Next/Vue】【Ant Design/Material UI】
Stars: ✭ 95 (+20.25%)
Mutual labels:  nextjs, material-ui
Nestpress
A production ready personal blogging system on top of NestJS and NEXT.js
Stars: ✭ 38 (-51.9%)
Mutual labels:  nextjs, material-ui
Web3studio Sojourn
A React Native DevKit with code for a Web3 Decentralized Data Storage Pattern.
Stars: ✭ 29 (-63.29%)
Mutual labels:  nextjs, material-ui
Nextjs Material Dashboard
NextJS version of Material Dashboard React
Stars: ✭ 50 (-36.71%)
Mutual labels:  nextjs, material-ui
Apollo Server Vercel
⚫ Production-ready Node.js GraphQL server for Vercel Serverless Functions
Stars: ✭ 69 (-12.66%)
Mutual labels:  nextjs
Gitexplorer Android
Find the right git commands πŸ”₯ without digging through the web.πŸ˜ŠπŸ˜ŠπŸ˜‰
Stars: ✭ 72 (-8.86%)
Mutual labels:  material-ui
Next Stats Action
GitHub action for generating stats for Next.js pull requests
Stars: ✭ 68 (-13.92%)
Mutual labels:  nextjs
Next Ts Template
Template for Next.js using parameterized typed routing
Stars: ✭ 67 (-15.19%)
Mutual labels:  nextjs
Nextjs Website Boilerplate
A Next.js website boilerplate that satisfies some common website requirements.
Stars: ✭ 74 (-6.33%)
Mutual labels:  nextjs
Next Storefront
πŸ›οΈ A dazzlingly fast E-Commerce solution built with Typescript and NextJS.
Stars: ✭ 72 (-8.86%)
Mutual labels:  nextjs
Android Material Design In Practice
A project to demonstrate the latest material design principles with simple examples. It has additional examples on how to easily scale texts on different screen sizes without extra effort.
Stars: ✭ 67 (-15.19%)
Mutual labels:  material-ui

NextJS with Redux and Material-UI example

A boilerplate NextJS with Redux and Material UI

Getting Started

Installing

Cloning the project.

git clone https://github.com/joaopaulomoraes/nextjs-with-redux-and-material-ui.git nextjs-with-redux-and-material-ui

Access the project directory.

cd nextjs-with-redux-and-material-ui

Install dependencies.

yarn install

Serve with hot reload at http://localhost:3000.

yarn dev

The idea behind the example

In this example, we will display a counter that is initialized with a value of 0 and will be updated with each click. The first rendering is happening on the server, then the browser takes over. To illustrate this, the rendered counter will have a value of 1 when the app loads and a flag with the dispatch source will be displayed above the counter. From the next clicks that increment / decrement, the counter will receive its new value and the flag with the origin will be updated again with the origin of the dispatch.

Our page is located in pages/index.js, so it will map the / route. To get the initial data for rendering, we are implementing the getInitialProps static method, initializing the redux storage and dispatching the increment action, passing the isServer parameter to identify that the dispatch source is coming from the server. As the component is packaged with next-redux-wrapper, the component is automatically connected to Redux and packaged with the reagent-redux Provider`, which allows us to access the redux state immediately and send the storage to the child components for that they access the state when necessary.

For security, it is recommended to wrap all pages, whether they use Redux or not, so you do not worry about all the child components anymore.

The withRedux function acceptsmakeStore as the first argument, all other arguments are passed internally to the react-redux connect () function. The makeStore function will receive the initialState as an argument and should return a new instance of redux store every time it is called, no memoisation is required here. See the [full example] (https://github.com/kirill-konshin/next-redux-wrapper#usage) in the Next Redux Wrapper repository. And there's another package [https://github.com/huzidaha/next-connect-redux] available with similar features.

To pass the initial state from the server to the client, we pass as a prop called initialState, so it is available when the client takes control.

The trick here to support the universal redux is to separate the cases for the client and the server. When we are on the server, we want to create a new store every time, otherwise the data from the different users will be mixed. If we are on the customer, we always want to use the same store. This is what we do in store.js

Again, the first render is happening in the server and instead of starting the count at 0, it will dispatch an action in redux that starts the count at 1. This continues to highlight how each navigation triggers a server render first and then a client render second, when you navigate between pages.


License

CC0

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].