Skip to main content
Module

x/htm/mod.tsx>Component

Create a html response with JSX.
Go to Latest
class Component
Abstract
import { Component } from "https://deno.land/x/htm@0.0.10/mod.tsx";

Constructors

new
Component(props?: P, context?: any)

Properties

optional
base: Element | Text
context: any
state: Readonly<S>

Methods

forceUpdate(callback?: () => void): void
abstract
render(
props?: RenderableProps<P>,
state?: Readonly<S>,
context?: any,
): ComponentChild
setState<K extends keyof S>(state: ((prevState: Readonly<S>, props: Readonly<P>) => Pick<S, K> | Partial<S> | null) | (Pick<S, K> | Partial<S> | null), callback?: () => void): void

Static Properties

optional
contextType: Context<any>
optional
defaultProps: any
optional
displayName: string

Static Methods

optional
getDerivedStateFromError(error: any): object | null
optional
getDerivedStateFromProps(props: Readonly<object>, state: Readonly<object>): object | null
interface Component
import { type Component } from "https://deno.land/x/htm@0.0.10/mod.tsx";

Type Parameters

optional
P = { }
optional
S = { }

Methods

optional
componentWillMount(): void
optional
componentDidMount(): void
optional
componentWillUnmount(): void
optional
getChildContext(): object
optional
componentWillReceiveProps(nextProps: Readonly<P>, nextContext: any): void
optional
shouldComponentUpdate(
nextProps: Readonly<P>,
nextState: Readonly<S>,
nextContext: any,
): boolean
optional
componentWillUpdate(
nextProps: Readonly<P>,
nextState: Readonly<S>,
nextContext: any,
): void
optional
getSnapshotBeforeUpdate(oldProps: Readonly<P>, oldState: Readonly<S>): any
optional
componentDidUpdate(
previousProps: Readonly<P>,
previousState: Readonly<S>,
snapshot: any,
): void
optional
componentDidCatch(error: any, errorInfo: ErrorInfo): void