Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Webpack #1

Merged
merged 2 commits into from
Nov 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 4 additions & 7 deletions src/App.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React from 'react'
import { useRouter } from './components/RouterProvider'
import './App.css'
import './components/styles/tailwind.css'

const styles = {
div: {
Expand All @@ -18,13 +19,9 @@ function App({ name }) {
const { setRouterPath } = useRouter() // set the route path to redirect to

return (
<div>
<div style={styles.div}>
<h1 style={styles.h1}>Hello {name}, Welcome to React Router Modal!</h1>
</div>

<br />
<button onClick={() => setRouterPath('/login')}>Go to Login Page</button>
<div className="container mx-auto p-4">
<span className="text-4xl font-bold mb-4">My Tailwind CSS React App</span>
{/* Add your components and content here */}
</div>
)
}
Expand Down
5 changes: 4 additions & 1 deletion src/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ import { createRoot } from 'react-dom/client'
import Router from './Router'

import './index.css'
import './components/styles/tailwind.css'

const Root = createRoot(document.getElementById('root'))
Root.render(<Router />)
Root.render(<div className="bg-blue-500 text-white p-4">
This should have a blue background with white text.
</div>)
2 changes: 1 addition & 1 deletion webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ module.exports = {
test: /\.css$/i,
use: [
process.env.NODE_ENV === 'production' ? MiniCssExtractPlugin.loader : 'style-loader',
'css-loader',
'css-loader'
],
},
{
Expand Down
Loading