feat: error if stateful hook is used outside of islands (#1778)
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
import { useState } from "preact/hooks";
|
||||
|
||||
export function HookIsland() {
|
||||
const [v, set] = useState(0);
|
||||
return (
|
||||
<div>
|
||||
<p>{v}</p>
|
||||
<button onClick={() => set((v) => v + 1)}>update</button>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user