diff --git a/packages/astro/test/react-component.test.js b/packages/astro/test/react-component.test.js index 3565342c2..7c0de3686 100644 --- a/packages/astro/test/react-component.test.js +++ b/packages/astro/test/react-component.test.js @@ -56,7 +56,7 @@ describe('React Components', () => { // test 11: Should generate unique React.useId per island const islandsWithId = $('.react-use-id'); expect(islandsWithId).to.have.lengthOf(2); - expect($(islandsWithId[0]).attr('id')).to.not.equal($(islandsWithId[1]).attr('id')) + expect($(islandsWithId[0]).attr('id')).to.not.equal($(islandsWithId[1]).attr('id')); }); it('Can load Vue', async () => { diff --git a/packages/integrations/react/client.js b/packages/integrations/react/client.js index 366d499e3..ef5929af1 100644 --- a/packages/integrations/react/client.js +++ b/packages/integrations/react/client.js @@ -14,8 +14,8 @@ export default (element) => (Component, props, { default: children, ...slotted }, { client }) => { if (!element.hasAttribute('ssr')) return; const renderOptions = { - identifierPrefix: element.getAttribute('prefix') - } + identifierPrefix: element.getAttribute('prefix'), + }; for (const [key, value] of Object.entries(slotted)) { props[key] = createElement(StaticHtml, { value, name: key }); } diff --git a/packages/integrations/react/context.js b/packages/integrations/react/context.js index 5d9b1d7b1..2e3e37fd5 100644 --- a/packages/integrations/react/context.js +++ b/packages/integrations/react/context.js @@ -17,7 +17,7 @@ function getContext(rendererContextResult) { } export function incrementId(rendererContextResult) { - const ctx = getContext(rendererContextResult) + const ctx = getContext(rendererContextResult); const id = ctx.id; ctx.currentIndex++; return id; diff --git a/packages/integrations/react/server.js b/packages/integrations/react/server.js index 0d85984f9..3f7e786ac 100644 --- a/packages/integrations/react/server.js +++ b/packages/integrations/react/server.js @@ -61,7 +61,7 @@ async function getNodeWritable() { async function renderToStaticMarkup(Component, props, { default: children, ...slotted }, metadata) { let prefix; if (this && this.result) { - prefix = incrementId(this.result) + prefix = incrementId(this.result); } const attrs = { prefix }; @@ -82,8 +82,8 @@ async function renderToStaticMarkup(Component, props, { default: children, ...sl } const vnode = React.createElement(Component, newProps); const renderOptions = { - identifierPrefix: prefix - } + identifierPrefix: prefix, + }; let html; if (metadata && metadata.hydrate) { if ('renderToReadableStream' in ReactDOM) {