JaeYeopHan / react-plate

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

react-plate

Do we still need a redux?

I think, we can manage state of application with Hooks API and Context API of React.

πŸ”« Killing Point

const GlobalContext = createContext(defaultValue)

export const GlobalProvider = ({ children }: { children: React.ReactNode }) => {
  const [state, dispatch] = useReducer(reducer, globalState)
  const value = useMemo(() => [state, dispatch], [state])

  return <GlobalContext.Provider value={value}>{children}</GlobalContext.Provider>
}

πŸ’‘ If you don't like TypeScript, you can see the VanillaJS version

β›‘ Structure

src
β”œβ”€β”€ api
β”œβ”€β”€ components
β”œβ”€β”€ containers
β”œβ”€β”€ modules
β”œβ”€β”€ routes
β”œβ”€β”€ utils
β”œβ”€β”€ App.tsx
└── index.tsx

πŸ“¦ Packages

Main

etc

Development Setting

More Details

βœ… TODO

Project by @Jbee✌

About


Languages

Language:TypeScript 85.3%Language:HTML 12.9%Language:JavaScript 1.8%