Skip to content

Instantly share code, notes, and snippets.

View Osara12's full-sized avatar
🏠
Working from home

Sarawoot Pattamapong Osara12

🏠
Working from home
  • Thailand
View GitHub Profile
@Osara12
Osara12 / AliveAbleRoutes.tsx
Created January 12, 2023 15:36 — forked from ajitid/AliveAbleRoutes.tsx
Keep alive routes
import React, { ReactElement, useState, useLayoutEffect } from 'react';
import { Routes, Route } from 'react-router-dom';
import type { RoutesProps, RouteProps } from 'react-router';
const AliveAbleRoutes = ({ children, ...props }: RoutesProps) => {
const routes = React.Children.toArray(children);
const keepAliveRoutes = routes.filter((route) => {
if (!React.isValidElement(route)) return false;
return route.type === KeepAliveRoute;
@Osara12
Osara12 / mage2-multiweb-subdir.md
Created April 19, 2022 09:34 — forked from thagxt/mage2-multiweb-subdir.md
Set up Magento 2 multiple websites in sub directories

Set up Magento 2 multiple websites in sub directories

  1. Go to Admin > Stores > All Stores
  2. Click > Create Web Site
  3. In the Name field, enter store name.
    • e.g. Japan
  4. In the Code field, enter a unique string without spaces and > Save Web Site
    • e.g. super_jp
  5. Create Store
  6. Create Store View