Skip to content

Commit fa5f1d3

Browse files
committed
Adding a few more fixes to the React Starter kit
1 parent 427e966 commit fa5f1d3

File tree

6 files changed

+49
-24
lines changed

6 files changed

+49
-24
lines changed

package-lock.json

Lines changed: 18 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
},
1212
"devDependencies": {
1313
"@inertiajs/react": "^2.0.0",
14+
"@types/react": "^19.0.3",
1415
"@vitejs/plugin-react": "^4.3.4",
1516
"autoprefixer": "^10.4.20",
1617
"axios": "^1.7.4",
@@ -49,4 +50,4 @@
4950
"tailwind-merge": "^2.5.5",
5051
"tailwindcss-animate": "^1.0.7"
5152
}
52-
}
53+
}

resources/js/components/app-sidebar.tsx

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Github, BookOpenText } from "lucide-react"
1+
import { BookOpenText, FolderGit2, LayoutDashboard, type LucideIcon } from "lucide-react"
22
import { Link } from "@inertiajs/react"
33
import { NavMain } from "@/components/nav-main"
44
import { NavFooter } from "@/components/nav-footer"
@@ -17,14 +17,23 @@ import ApplicationLogo from "./application-logo"
1717
interface NavItem {
1818
title: string
1919
url: string
20-
icon: React.ComponentType
20+
icon: LucideIcon
21+
isActive?: boolean
2122
}
2223

24+
const mainNavItems: NavItem[] = [
25+
{
26+
title: "Dashboard",
27+
url: "/dashboard",
28+
icon: LayoutDashboard,
29+
},
30+
]
31+
2332
const footerNavItems: NavItem[] = [
2433
{
25-
title: "Github Repo",
34+
title: "Repository",
2635
url: "https://github.com/laravel/react-starter-kit",
27-
icon: Github,
36+
icon: FolderGit2,
2837
},
2938
{
3039
title: "Documentation",
@@ -55,7 +64,7 @@ export function AppSidebar() {
5564
</SidebarHeader>
5665

5766
<SidebarContent>
58-
<NavMain />
67+
<NavMain items={mainNavItems} />
5968
</SidebarContent>
6069

6170
<SidebarFooter>

resources/js/components/nav-main.tsx

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"use client"
22

3-
import { LayoutDashboard, type LucideIcon } from "lucide-react"
3+
import { type LucideIcon } from "lucide-react"
44
import { Link } from "@inertiajs/react"
55
import {
66
SidebarGroup,
@@ -24,14 +24,6 @@ export function NavMain({ items = [] }: NavMainProps) {
2424
return (
2525
<SidebarGroup>
2626
<SidebarMenu>
27-
<SidebarMenuItem>
28-
<SidebarMenuButton asChild isActive>
29-
<Link href={route('dashboard')} prefetch>
30-
<LayoutDashboard />
31-
<span>Dashboard</span>
32-
</Link>
33-
</SidebarMenuButton>
34-
</SidebarMenuItem>
3527
{items.map((item) => (
3628
<SidebarMenuItem key={item.title}>
3729
<SidebarMenuButton asChild isActive={item.isActive}>

tsconfig.json

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
// "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */
1212

1313
/* Language and Environment */
14-
"target": "es2016", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */
14+
"target": "ESNext", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */
1515
// "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */
1616
// "jsx": "preserve", /* Specify what JSX code is generated. */
1717
// "experimentalDecorators": true, /* Enable experimental support for legacy experimental decorators. */
@@ -25,9 +25,9 @@
2525
// "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */
2626

2727
/* Modules */
28-
"module": "commonjs", /* Specify what module code is generated. */
28+
"module": "ESNext", /* Specify what module code is generated. */
2929
// "rootDir": "./", /* Specify the root folder within your source files. */
30-
// "moduleResolution": "node10", /* Specify how TypeScript looks up a file from a given module specifier. */
30+
"moduleResolution": "bundler", /* Specify how TypeScript looks up a file from a given module specifier. */
3131
// "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
3232
// "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */
3333
// "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
@@ -46,7 +46,7 @@
4646
// "noResolve": true, /* Disallow 'import's, 'require's or '<reference>'s from expanding the number of files TypeScript should add to a project. */
4747

4848
/* JavaScript Support */
49-
// "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */
49+
"allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */
5050
// "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */
5151
// "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */
5252

@@ -56,7 +56,7 @@
5656
// "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */
5757
// "sourceMap": true, /* Create source map files for emitted JavaScript files. */
5858
// "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */
59-
// "noEmit": true, /* Disable emitting files from a compilation. */
59+
"noEmit": true, /* Disable emitting files from a compilation. */
6060
// "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */
6161
// "outDir": "./", /* Specify an output folder for all emitted files. */
6262
// "removeComments": true, /* Disable emitting comments. */
@@ -74,7 +74,7 @@
7474
// "declarationDir": "./", /* Specify the output directory for generated declaration files. */
7575

7676
/* Interop Constraints */
77-
// "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */
77+
"isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */
7878
// "verbatimModuleSyntax": true, /* Do not transform or elide any imports or exports not marked as type-only, ensuring they are written in the output file's format based on the 'module' setting. */
7979
// "isolatedDeclarations": true, /* Require sufficient annotation on exports so other tools can trivially generate declaration files. */
8080
// "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */
@@ -109,8 +109,10 @@
109109
"skipLibCheck": true, /* Skip type checking all .d.ts files. */
110110
"baseUrl": ".",
111111
"paths": {
112-
"@/*": ["resources/js/*"]
112+
"@/*": ["./resources/js/*"],
113+
"ziggy-js": ["./vendor/tightenco/ziggy"]
113114
},
114-
"jsx": "react"
115-
}
115+
"jsx": "react-jsx"
116+
},
117+
"include": ["resources/js/**/*.ts", "resources/js/**/*.tsx", "resources/js/**/*.d.ts"]
116118
}

vite.config.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,7 @@ export default defineConfig({
1212
}),
1313
react(),
1414
],
15+
esbuild: {
16+
jsx: 'automatic'
17+
}
1518
});

0 commit comments

Comments
 (0)