Skip to content

Instantly share code, notes, and snippets.

@zcemycl
Last active January 27, 2025 12:20
Show Gist options
  • Save zcemycl/b0bb5148bdab06608dc10ad301e9f0f4 to your computer and use it in GitHub Desktop.
Save zcemycl/b0bb5148bdab06608dc10ad301e9f0f4 to your computer and use it in GitHub Desktop.
React + Tailwindcss + Typescript 2025-01-27

React + Tailwindcss + Typescript 2025-01-27

Just a note to avoid setup hell for react19 + tailwindcss + typescript, here i use vite.

  1. Create project via vite. npm create vite@latest
    • Name
    • React for framework
    • Typescript (i don't like React Router v7, looks more confused than Next)
  2. Install tailwindcss in reference 1.
    • Use tailwindcss@3 npm install -D tailwindcss@3 postcss autoprefixer since init does not exist in 4.
  3. Add path alias in reference 2.
  4. Add react router.

References

  1. https://medium.com/@pushpendrapal_/how-to-setup-react-typescript-and-tailwind-css-with-vite-in-a-project-8d9b0b51d1bd
  2. https://medium.com/@devxprite/how-to-setup-path-aliases-in-vite-df955939ffe8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment