feat: error if stateful hook is used outside of islands (#1778)
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
import { HookIsland } from "../../islands/HookIsland.tsx";
|
||||
|
||||
export default function Page() {
|
||||
return <HookIsland />;
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
import { useReducer } from "preact/hooks";
|
||||
|
||||
export default function Page() {
|
||||
useReducer(() => {}, undefined);
|
||||
return <h1>useReducer</h1>;
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
import { useState } from "preact/hooks";
|
||||
|
||||
export default function Page() {
|
||||
useState();
|
||||
return <h1>useState</h1>;
|
||||
}
|
||||
Reference in New Issue
Block a user