MCPcopy
hub / github.com/visgl/deck.gl / onRenderHTML

Method onRenderHTML

modules/widgets/src/toggle-widget.tsx:68–94  ·  view source on GitHub ↗
(rootElement: HTMLElement)

Source from the content-addressed store, hash-verified

66 }
67
68 onRenderHTML(rootElement: HTMLElement): void {
69 const {
70 className,
71 style,
72 icon,
73 label,
74 color,
75 onIcon = icon,
76 onLabel = label,
77 onColor = color
78 } = this.props;
79 const on = this.checked;
80
81 rootElement.dataset.checked = String(on);
82
83 render(
84 <IconButton
85 className={className}
86 style={style as JSX.CSSProperties}
87 icon={on ? onIcon : icon}
88 label={on ? onLabel : label}
89 color={on ? onColor : color}
90 onClick={this._toggle}
91 />,
92 rootElement
93 );
94 }
95
96 private _toggle = () => {
97 this.checked = !this.checked;

Callers

nothing calls this directly

Calls 2

StringClass · 0.85
renderFunction · 0.50

Tested by

no test coverage detected