npm create vite@latest login-page
# template: react + vanilla.js
cd login-page/
npm i && npm run dev # works, so ctrl+c and
git init && git remote add origin https://github.com/2701kai/login-page.gitgit push -u origin main # finally worked, :tada:..nothing fancy yet.
-
input form created
-
router installed:
npm i react-router-domwhat´s a router?
URLs mapped to components. So
/logincan show<Login />, and/dashboardcan show<Dashboard />. React doesn’t have built-in routing, so we usereact-router-dom. -
main.jsx updated
leaving tailwind for now, I opted for uno.css.
npm install -D unocss
# @root:
touch uno.config.js #and edit with// uno.config.js
import { defineConfig, presetUno } from "unocss";
export default defineConfig({
presets: [presetUno()],
});then update vite.config.js respectively, adding UnoCSS as plugin:
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
import UnoCSS from "unocss/vite";
export default defineConfig({
plugins: [react(), UnoCSS()],
});more: UnoCSS