Skip to content

Commit

Permalink
Merge pull request #4372 from preactjs/rschristian-patch-1
Browse files Browse the repository at this point in the history
fix: Syntax in `compat/client` for IE11 support
  • Loading branch information
rschristian authored May 6, 2024
2 parents d18ac9f + 41ce33b commit 414c870
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions compat/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@ const { render, hydrate, unmountComponentAtNode } = require('preact/compat');

function createRoot(container) {
return {
render(children) {
// eslint-disable-next-line
render: function (children) {
render(children, container);
},
unmount() {
// eslint-disable-next-line
unmount: function () {
unmountComponentAtNode(container);
}
};
Expand Down
6 changes: 4 additions & 2 deletions compat/client.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@ import { render, hydrate, unmountComponentAtNode } from 'preact/compat';

export function createRoot(container) {
return {
render(children) {
// eslint-disable-next-line
render: function (children) {
render(children, container);
},
unmount() {
// eslint-disable-next-line
unmount: function () {
unmountComponentAtNode(container);
}
};
Expand Down

0 comments on commit 414c870

Please sign in to comment.