This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
Currently, two official plugins are available:
- @vitejs/plugin-react uses Babel for Fast Refresh
- @vitejs/plugin-react-swc uses SWC for Fast Refresh
- pnpm create vite taskapp --template react
- pnpm --version ^ 8.12.1
- pnpm i dotenv firebase react-hot-toast react-loading-skeleton react-router-dom
- pnpm i -d eslint @types/react prettier
- pnpm create @eslint/config
- pnpm i -d @types/react
- pnpm i -d stylelint-config-idiomatic-order stylelint-config-idiomatic-order
` import { useContext } from "react"; import { createContext } from "react";
const AuthContext = createContext();
export const UseAuth = () => { const ctx = useContext(AuthContext); if (!ctx) { throw new Error("authContext debe ser usado dentro de AuthProvider"); } return ctx; };
export function AuthProvider({ children }) { const extData = {};
return ( <AuthContext.Provider value={extData}>{children}</AuthContext.Provider> ); } `