refactor: remove unused components and files; update List component to use client-side rendering
- Deleted List.tsx, action.tsx, react.svg, client.tsx, entry.browser.tsx, entry.rsc.tsx, entry.ssr.tsx, error-boundary.tsx, request.tsx, index.css, and root.tsx as they were no longer needed. - Updated List component in pages/a/index.tsx to use useEffect for client-side behavior. - Removed pages/b/index.tsx as it was redundant. - Added new browser-entry.tsx and entry.tsx for client-side and server-side rendering respectively. - Introduced versioned component in pages/v/a/index.tsx to demonstrate async data fetching. - Updated tsconfig.json to allow unused local variables.x
This commit is contained in:
@@ -1,9 +1,12 @@
|
||||
'use server';
|
||||
import { useEffect } from "react";
|
||||
|
||||
export default async function List() {
|
||||
export default function List() {
|
||||
useEffect(() => {
|
||||
console.log('useEffect in List');
|
||||
}, []);
|
||||
return (
|
||||
<div>
|
||||
<h1>List A</h1>
|
||||
<h1>List 2</h1>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
'use server';
|
||||
|
||||
export default async function List() {
|
||||
return (
|
||||
<div>
|
||||
<h1>List B</h1>
|
||||
<div>123</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
18
src/pages/v/a/index.tsx
Normal file
18
src/pages/v/a/index.tsx
Normal file
@@ -0,0 +1,18 @@
|
||||
'use server';
|
||||
import { useEffect } from "react";
|
||||
|
||||
const getVersion = async () => {
|
||||
await new Promise(resolve => setTimeout(resolve, 1000));
|
||||
return '1.0.0';
|
||||
}
|
||||
export default async function List() {
|
||||
const v = await getVersion();
|
||||
return (
|
||||
<div>
|
||||
<h1>List - Version {v}</h1>
|
||||
<div style={{
|
||||
width: 200
|
||||
}}>Primary Button</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user