How to use the h function from preact
Find comprehensive JavaScript preact.h code examples handpicked from public code repositorys.
GitHub: slinkity/slinkity
1 2 3 4 5 6 7 8 9 10 11
const renderToString = require('preact-render-to-string'); const pkg = require('./package.json'); module.exports = async function ssr({ Component, props, ssrLoadModule, javascriptFunctions }) { const { FunctionsContext } = await ssrLoadModule(`${pkg.name}/server`); const vnode = h(FunctionsContext.Provider, { value: javascriptFunctions }, h(Component.default, props)); return { html: renderToString(vnode), css: undefined, };
35
430
0
GitHub: mmNalaka/mdx
4 5 6 7 8 9 10 11 12 13
const TYPE_PROP_NAME = 'mdxType' const DEFAULTS = { inlineCode: 'code', wrapper: ({children}) => h(Fragment, {}, children) } const MDXCreateElement = forwardRef((props, ref) => { const {
0
0
1
+ 11 other calls in file
preact.options is the most popular function in preact (790 examples)