deno.land / x / ultra@v2.3.8 / hooks / use-server-inserted-html.js

use-server-inserted-html.js
نووسراو ببینە
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import { useContext } from "react";import ServerInsertedHTMLContext from "./server-inserted-html-context.js";
/** * @param {() => React.ReactNode} callback * @returns {void} */export default function useServerInsertedHTML(callback) { const addInsertedServerHTMLCallback = useContext(ServerInsertedHTMLContext); // Should have no effects on client where there's no flush effects provider if (addInsertedServerHTMLCallback) { addInsertedServerHTMLCallback(callback); }}
ultra

Version Info

Tagged at
8 months ago