-
-
Notifications
You must be signed in to change notification settings - Fork 205
How to use React 95 in the React project that was built by Vite? #394
-
Hello everybody! I'm interested in React 95, but usually, I create a React project by Vite. So I want to know how to do it. Thank you.
Oct. 26, 2024 in China.
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 1 comment
-
Hey! 👋
React95 and Vite are both great choices for building a project! To set up a React95 project with Vite, you can follow these steps:
Steps to Set Up React95 with Vite
Create a Vite Project: Start by creating a new Vite project with React. Open your terminal and run:
npm create vite@latest my-react95-app --template react
cd my-react95-app
Install React95: Once the project is created, install the react95 package along with styled-components (required by React95):
npm install react95 styled-components
Add React95 Styles: Import the default React95 theme in your main entry file (usually main.jsx or App.jsx):
javascript
import { ThemeProvider, GlobalStyle, original } from 'react95';
import 'react95/dist/react95.min.css';
function App() {
return (
{/* Your app components go here */}
);
}
export default App;
Use React95 Components: Now you can start using React95 components! Here’s an example:
javascript
import { Button } from 'react95';
function App() {
return (
Click me!
);
}
Run the App: Finally, start your Vite development server:
npm run dev
That’s it! You should now have a Vite-based React app styled with React95 components. Let me know if you need further help! 😊
Beta Was this translation helpful? Give feedback.