Raw Components
If you are controlling the created HTML DOM instance yourself, you can mark the node as raw to disable deeper reconciliation.
By default, on every update, .dom
will reconcile the children of each VNode instance. This will destroy any previous modifications to the DOM. To disable this functionality, set hooks.r
to a truthy value (eg. 1
or true
):
const RawComponent = (props, state, setState, hooks) => {
// Mark the component as raw
hooks.r = 1;
}
HTML Component
One use of the raw components is to render plain HTML strings. For example:
ZnVuY3Rpb24gUmVuZGVySFRNTCh7aHRtbH0sIHN0YXRlLCBzZXRTdGF0ZSwgaG9va3MpIHsKICBob29rcy5yID0gdHJ1ZTsKICByZXR1cm4gSCgmIzM0O2RpdiYjMzQ7LCB7CiAgICBpbm5lckhUTUw6IGh0bWwKICB9KQp9CgpSKAogIEgoUmVuZGVySFRNTCwgewogICAgaHRtbDogJiMzNDsmbHQ7cCZndDtIZWxsbyAmbHQ7YiZndDtXb3JsZCZsdDsvYiZndDsmbHQ7L3AmZ3Q7JiMzNDsgCiAgfSksCiAgZG9jdW1lbnQuYm9keQop
Loading interactive example...
Previous Topic
Next Topic