Skip to content

Instantly share code, notes, and snippets.

View Rizki36's full-sized avatar
Working hard

Rizki Fitra R Rizki36

Working hard
View GitHub Profile
@justincy
justincy / README.md
Last active April 5, 2024 22:19
Configure Storybook to work with Next.js, TypeScript, and CSS Modules

In addition to the Storybook for React setup, you'll also need to install these packages:

npm i -D @babel/core babel-loader css-loader style-loader
@jeffersonRibeiro
jeffersonRibeiro / nextjs-ssr-csr-auth-hoc.js
Last active September 29, 2022 12:14
Nextjs HOC to deal with authentication for SSR and CSR pages
import React from 'react';
import { Router } from 'next-router';
import getAuthSession from 'services/authSession';
function redirect(res) {
if (res) {
// SSR
res.writeHead(302, { Location: '/' });
res.end();