Skip to main content
Module

x/sift/mod.ts>jsx

Sift is a routing and utility library for Deno Deploy.
Latest
function jsx
import { jsx } from "https://deno.land/x/sift@0.6.0/mod.ts";

Renders JSX components to HTML and returns a Response with text/html as the content-type.

Examples

Example 1

import { serve, jsx, h } from "https://deno.land/x/sift/mod.ts"

const Greet = ({name}) => <div>Hello, {name}</div>;

serve({
 "/": () => jsx(<html><Greet name="Sift" /></html),
})

Make sure your file extension is either .tsx or .jsx and you've h imported when using this function.

Parameters

jsx: VNode
optional
init: ResponseInit