Skip to content
Draft
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Configure react
  • Loading branch information
colebemis committed Aug 20, 2023
commit af89f6b746428e97665d6b94d8ebd8777f1dbc41
8 changes: 4 additions & 4 deletions docs/astro.config.mjs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { defineConfig } from 'astro/config';

import tailwind from "@astrojs/tailwind";
import tailwind from '@astrojs/tailwind';
import react from '@astrojs/react';

// https://astro.build/config
export default defineConfig({
integrations: [tailwind()]
});
integrations: [tailwind(), react()],
});
104 changes: 104 additions & 0 deletions docs/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,13 @@
"preview": "astro preview"
},
"dependencies": {
"@astrojs/react": "^2.3.2",
"@astrojs/tailwind": "^4.0.0",
"@types/react": "^18.2.20",
"@types/react-dom": "^18.2.7",
"astro": "^2.10.12",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"tailwindcss": "^3.3.3"
}
}
3 changes: 3 additions & 0 deletions docs/src/components/button.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export function Button(props: React.ComponentPropsWithoutRef<'button'>) {
return <button className="bg-emerald-300" {...props} />;
}
2 changes: 2 additions & 0 deletions docs/src/pages/index.astro
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
import {Button} from '../components/Button'
// Welcome to Astro! Everything between these triple-dash code fences
// is your "component frontmatter". It never runs in the browser.
console.log('This runs in your terminal, not the browser!');
Expand All @@ -9,5 +10,6 @@ console.log('This runs in your terminal, not the browser!');
<html>
<body>
<h1 class="text-orange-600">Hello, World!</h1>
<Button>Click me</Button>
</body>
</html>
8 changes: 6 additions & 2 deletions docs/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
{
"extends": "astro/tsconfigs/base"
}
"extends": "astro/tsconfigs/base",
"compilerOptions": {
"jsx": "react-jsx",
"jsxImportSource": "react"
}
}