Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/deco/deps.ts>Component

Git-based Visual CMS for Deno, </> htmx and Tailwind apps. Deploy on any Deno-compatible host.
Go to Latest
class Component
Abstract
import { Component } from "https://deno.land/x/deco@1.75.1/deps.ts";

Constructors

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

Properties

optional
base: Element | Text
context: any
props: RenderableProps<P>
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/deco@1.75.1/deps.ts";

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