summaryrefslogtreecommitdiff
path: root/src/compiler/codegen.ts
diff options
context:
space:
mode:
authorGravatar Drew Powers <1369770+drwpow@users.noreply.github.com> 2021-04-02 12:48:41 -0600
committerGravatar GitHub <noreply@github.com> 2021-04-02 14:48:41 -0400
commit004b3ea6a0b48ecc04d2a0daf9aae374983bed08 (patch)
tree9f9d6fd801f8c512e43832aedbb49add8e51f371 /src/compiler/codegen.ts
parent5a1f42288332648ed2436e9a4392dab446dcc2d4 (diff)
downloadastro-004b3ea6a0b48ecc04d2a0daf9aae374983bed08.tar.gz
astro-004b3ea6a0b48ecc04d2a0daf9aae374983bed08.tar.zst
astro-004b3ea6a0b48ecc04d2a0daf9aae374983bed08.zip
Fix React import (#55)
* Fix React import * Change default export * Fix :visible dynamic component * Use colon to alias vue createElement Co-authored-by: Matthew Phillips <matthew@skypack.dev>
Diffstat (limited to 'src/compiler/codegen.ts')
-rw-r--r--src/compiler/codegen.ts4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/compiler/codegen.ts b/src/compiler/codegen.ts
index 2486ef92f..0447cbdc7 100644
--- a/src/compiler/codegen.ts
+++ b/src/compiler/codegen.ts
@@ -170,7 +170,7 @@ function getComponentWrapper(_name: string, { type, plugin, url }: ComponentInfo
case 'react': {
if (['load', 'idle', 'visible'].includes(kind)) {
return {
- wrapper: `__preact_${kind}(${name}, ${JSON.stringify({
+ wrapper: `__react_${kind}(${name}, ${JSON.stringify({
componentUrl: getComponentUrl(),
componentExport: 'default',
frameworkUrls: {
@@ -178,7 +178,7 @@ function getComponentWrapper(_name: string, { type, plugin, url }: ComponentInfo
'react-dom': dynamicImports.get('react-dom'),
},
})})`,
- wrapperImport: `import {__preact_${kind}} from '${internalImport('render/preact.js')}';`,
+ wrapperImport: `import {__react_${kind}} from '${internalImport('render/react.js')}';`,
};
}