mirror of
https://github.com/cloudflare/vinext.git
synced 2026-09-14 19:04:59 +08:00
e46b9bae91
* fix: rewrite error for react hooks without directive * comments * bonk
20 lines
538 B
TypeScript
20 lines
538 B
TypeScript
/**
|
|
* Reproduces https://github.com/cloudflare/vinext/issues/834 for React hooks.
|
|
*
|
|
* This is a SERVER component (no "use client" directive) that calls
|
|
* useState() from react. It should throw a clear error telling the
|
|
* developer to add "use client", not a cryptic "is not a function".
|
|
*/
|
|
import { useState } from "react";
|
|
|
|
export default function MissingUseClientReactHookPage() {
|
|
const [count] = useState(0);
|
|
|
|
return (
|
|
<div>
|
|
<h1>Missing use client react hook test</h1>
|
|
<p>Count: {count}</p>
|
|
</div>
|
|
);
|
|
}
|