0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2025-01-13 22:11:20 -05:00

[ci] format

This commit is contained in:
ematipico 2023-05-04 14:25:03 +00:00 committed by fredkbot
parent ca329bbcae
commit 14fd198ea5
4 changed files with 7 additions and 7 deletions

View file

@ -56,7 +56,7 @@ describe('React Components', () => {
// test 11: Should generate unique React.useId per island // test 11: Should generate unique React.useId per island
const islandsWithId = $('.react-use-id'); const islandsWithId = $('.react-use-id');
expect(islandsWithId).to.have.lengthOf(2); 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 () => { it('Can load Vue', async () => {

View file

@ -14,8 +14,8 @@ export default (element) =>
(Component, props, { default: children, ...slotted }, { client }) => { (Component, props, { default: children, ...slotted }, { client }) => {
if (!element.hasAttribute('ssr')) return; if (!element.hasAttribute('ssr')) return;
const renderOptions = { const renderOptions = {
identifierPrefix: element.getAttribute('prefix') identifierPrefix: element.getAttribute('prefix'),
} };
for (const [key, value] of Object.entries(slotted)) { for (const [key, value] of Object.entries(slotted)) {
props[key] = createElement(StaticHtml, { value, name: key }); props[key] = createElement(StaticHtml, { value, name: key });
} }

View file

@ -17,7 +17,7 @@ function getContext(rendererContextResult) {
} }
export function incrementId(rendererContextResult) { export function incrementId(rendererContextResult) {
const ctx = getContext(rendererContextResult) const ctx = getContext(rendererContextResult);
const id = ctx.id; const id = ctx.id;
ctx.currentIndex++; ctx.currentIndex++;
return id; return id;

View file

@ -61,7 +61,7 @@ async function getNodeWritable() {
async function renderToStaticMarkup(Component, props, { default: children, ...slotted }, metadata) { async function renderToStaticMarkup(Component, props, { default: children, ...slotted }, metadata) {
let prefix; let prefix;
if (this && this.result) { if (this && this.result) {
prefix = incrementId(this.result) prefix = incrementId(this.result);
} }
const attrs = { prefix }; const attrs = { prefix };
@ -82,8 +82,8 @@ async function renderToStaticMarkup(Component, props, { default: children, ...sl
} }
const vnode = React.createElement(Component, newProps); const vnode = React.createElement(Component, newProps);
const renderOptions = { const renderOptions = {
identifierPrefix: prefix identifierPrefix: prefix,
} };
let html; let html;
if (metadata && metadata.hydrate) { if (metadata && metadata.hydrate) {
if ('renderToReadableStream' in ReactDOM) { if ('renderToReadableStream' in ReactDOM) {