Skip to content

Commit

Permalink
Try jsx transform
Browse files Browse the repository at this point in the history
  • Loading branch information
JoviDeCroock committed Oct 3, 2024
1 parent 58ea2b5 commit 4135462
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 1 deletion.
8 changes: 7 additions & 1 deletion benches/proxy-packages/preact-hooks-proxy/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
import { render, hydrate } from 'preact';
import { jsx } from 'preact/jsx-runtime';

export * from 'preact/hooks';
export * from 'preact';
export * from 'preact/hooks';

export const createElement = (type, props, children) => {
props.children = children;
return jsx(type, props, props.key);
};

/**
* @param {HTMLElement} rootDom
Expand Down
6 changes: 6 additions & 0 deletions benches/proxy-packages/preact-local-proxy/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
import { render, hydrate } from 'preact';
import { jsx } from 'preact/jsx-runtime';

export * from 'preact';

export const createElement = (type, props, children) => {
props.children = children;
return jsx(type, props, props.key);
};

/**
* @param {HTMLElement} rootDom
* @returns {{ render(vnode: JSX.Element): void; hydrate(vnode: JSX.Element): void; }}
Expand Down
6 changes: 6 additions & 0 deletions benches/proxy-packages/preact-main-proxy/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
import { render, hydrate } from 'preact';
import { jsx } from 'preact/jsx-runtime';

export * from 'preact';

// export const createElement = (type, props, children) => {
// props.children = children
// return jsx(type, props, props.key)
// }

/**
* @param {HTMLElement} rootDom
* @returns {{ render(vnode: JSX.Element): void; hydrate(vnode: JSX.Element): void; }}
Expand Down
2 changes: 2 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,5 @@ export { cloneElement } from './clone-element';
export { createContext } from './create-context';
export { toChildArray } from './diff/children';
export { default as options } from './options';

// TEMP

0 comments on commit 4135462

Please sign in to comment.