@appsemble/preact
Advanced tools
Comparing version 0.17.2 to 0.17.3
@@ -0,3 +1,4 @@ | ||
import { jsx as _jsx } from "preact/jsx-runtime"; | ||
import { bootstrap as sdkBootstrap } from '@appsemble/sdk'; | ||
import { createContext, h, render } from 'preact'; | ||
import { createContext, render } from 'preact'; | ||
import { useContext } from 'preact/hooks'; | ||
@@ -14,2 +15,3 @@ const Context = createContext(null); | ||
return (params) => new Promise((ready) => { | ||
// eslint-disable-next-line react/jsx-no-constructed-context-values | ||
const props = { | ||
@@ -19,4 +21,3 @@ ...params, | ||
}; | ||
const component = (h(Context.Provider, { value: props }, | ||
h(Component, Object.assign({}, props)))); | ||
const component = (_jsx(Context.Provider, Object.assign({ value: props }, { children: _jsx(Component, Object.assign({}, props), void 0) }), void 0)); | ||
render(component, params.shadowRoot); | ||
@@ -39,3 +40,3 @@ params.utils.addCleanup(() => render(null, params.shadowRoot)); | ||
export function withBlock(Component) { | ||
return (props) => (h(Context.Consumer, null, (values) => h(Component, Object.assign({}, props, values)))); | ||
return (props) => (_jsx(Context.Consumer, { children: (values) => _jsx(Component, Object.assign({}, props, values), void 0) }, void 0)); | ||
} | ||
@@ -42,0 +43,0 @@ export function useBlock() { |
{ | ||
"name": "@appsemble/preact", | ||
"version": "0.17.2", | ||
"version": "0.17.3", | ||
"description": "Build your own blocks using Preact", | ||
@@ -37,5 +37,5 @@ "keywords": [ | ||
"peerDependencies": { | ||
"@appsemble/sdk": "0.17.2", | ||
"@appsemble/sdk": "0.17.3", | ||
"preact": "^10" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5251
70