mirror of
https://github.com/withastro/astro.git
synced 2024-12-30 22:03:56 -05:00
[ci] format
This commit is contained in:
parent
ca329bbcae
commit
14fd198ea5
4 changed files with 7 additions and 7 deletions
|
@ -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 () => {
|
||||
|
|
|
@ -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 });
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue