DEV Community

Ipii
Ipii

Posted on

How to install React and Tailwind in Termux

Hello! this is my first post on dev.to. i hope y'all understand to my tutorial. how to install react on termux android. 😁😁

1. Update your packages in termux

First, you need to update the packages in termux. here is the command how to update the packages :

pkg update && pkg upgrade -y
Enter fullscreen mode Exit fullscreen mode

2. Install nodejs in termux
Next, you need to install nodejs in termux :

pkg install nodejs -y
Enter fullscreen mode Exit fullscreen mode

3. Create your react app
You need to create app here is the command looks like :

npx create-react-app <your-project-name>
cd <your-project-name>
Enter fullscreen mode Exit fullscreen mode

e.g

npx create-react-app react-app
cd react-app
Enter fullscreen mode Exit fullscreen mode

4. Install tailwind css
You need to install tailwind with npm here is the command :

npm install -D tailwindcss
npx tailwindcss init
Enter fullscreen mode Exit fullscreen mode

5. Edit configuration tailwind css
You need configuration tailwind css for react in tailwind.config.js file. you can use nano or vim to open the file configuration.

If you don't have nano in termux you need to install it
pkg install nano -y
now you can use nano like this :
nano <your-file-name>

so, we comeback to the topic we open the file configuration in termux with text editor like this :

nano tailwind.config.js
Enter fullscreen mode Exit fullscreen mode

edit inside file or replace the text with this :

/** @type {import('tailwindcss').Config} */
module.exports = {
  content: [
    "./src/**/*.{js,jsx,ts,tsx}",
  ],
  theme: {
    extend: {},
  },
  plugins: [],
}
Enter fullscreen mode Exit fullscreen mode

after that save the file in nano with ctrl + x, y, enter

6. Add @tailwindcss in file css
open the file index.css in folder ./src/index.css with nano like this :

nano ./src/index.css
Enter fullscreen mode Exit fullscreen mode

add @tailwindcss at top of the line file

@tailwind base;
@tailwind components;
@tailwind utilities;
Enter fullscreen mode Exit fullscreen mode

Now you can run the react app with tailwind in termux :). you can run the react app with :

npm run dev
Enter fullscreen mode Exit fullscreen mode

or

npm run start
Enter fullscreen mode Exit fullscreen mode

that is my tutorial i hope you all understand with my tutorial hehe. because is my first post you can support me i will post the tutorial next time haha.

Source :

https://tailwindcss.com/docs/guides/create-react-app

Top comments (0)