GithubHelp home page GithubHelp logo

chrisnajman / vite-basic-with-routing Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 388 KB

Vite routing setup with easy publish to Git Pages. Includes a custom 404 page, and dynamic sub-routes.

Home Page: https://chrisnajman.github.io/vite-basic-with-routing/

License: MIT License

JavaScript 63.59% HTML 18.44% CSS 17.97%
github-pages-website react-router-dom reactjs useparams-hook vitejs

vite-basic-with-routing's Introduction

Vite with Basic Routing

Vite Setup (with Routing) and Easy Publish to Git Pages

This is a clone of "vite-react-router" (Github repo) by Erick Kuwahara with the following differences:

  • I converted .tsx (typescript) files to .jsx.
  • VS Code was complaining about it, so in main.tsx (which I renamed main.jsx) I removed as HTMLElement from: ReactDOM.createRoot(document.getElementById("root") as HTMLElement).render(...
  • I extracted the nav to its own component (components/Nav.js).
  • I created a custom 404 page (/src/pages/NotFoundPage.jsx).
  • I created a 'Profiles' page (/src/pages/Profiles.jsx) with sub-routes (/src/pages/Profile.jsx).

Installation and configuring the Git Repo

For all installation and configuration instructions see Erick's Github repo (link above).

You can also watch his step-by-step YouTube tutorial: Vite React App with Routes Deployed on Github | Reload error resolved!.

Important

The installation and configuration options omit a key step: Once you've finished following the instructions, go to settings/pages. Under 'Build and Deployment > Branch' select 'gh-pages' as the branch. Then click 'Save'.

vite-basic-with-routing's People

Contributors

chrisnajman avatar dependabot[bot] avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.