How to use the render function from preact

Find comprehensive JavaScript preact.render code examples handpicked from public code repositorys.

13
14
15
16
17
18
19
20
21
22
  return vdom;
};

const createSpy = (spy, Component) => {
  class Spy extends Component {
    render(...args) {
      const output = super.render(...args);
      spy._output(this, output);
      return spyWalk(spy, output);
    }
fork icon24
star icon0
watch icon1

+ 11 other calls in file

121
122
123
124
125
126
module.exports = exports = h.bind(null, preact.createElement);

exports.h = exports;
exports.isVNode = isPreactNode;
exports.Component = preact.Component;
exports.render = preact.render;
fork icon5
star icon6
watch icon9

+ 3 other calls in file

26
27
28
29
30
31
32
33
34
35
var callbackQ = [];
function execCallbackSync(callback) {
    callbackQ.push(callback);
}
preact.options.debounceRendering = execCallbackSync;
preact.render(preact.createElement(FakeComponent, {}), document.createElement('div'));
while (callbackQ.length) {
    callbackQ.shift()();
}
preact.options.debounceRendering = oldDebounceRendering;
fork icon0
star icon0
watch icon0

+ 11 other calls in file

57
58
59
60
61
62
63
64
65
66
this.#updateUI = debounce((state) => {
  // plugin could be removed, but this.rerender is debounced below,
  // so it could still be called even after uppy.removePlugin or uppy.close
  // hence the check
  if (!this.uppy.getPlugin(this.id)) return
  render(this.render(state), uppyRootElement)
  this.afterUpdate()
})

this.uppy.log(`Installing ${callerPluginName} to a DOM element '${target}'`)
fork icon0
star icon0
watch icon2

+ 11 other calls in file