Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@astrojs/react

Package Overview
Dependencies
Maintainers
3
Versions
103
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@astrojs/react - npm Package Compare versions

Comparing version 0.0.0-self-closing-children-20231120171409 to 0.0.0-self-closing-children-20231120173528

4

package.json
{
"name": "@astrojs/react",
"description": "Use React components within Astro",
"version": "0.0.0-self-closing-children-20231120171409",
"version": "0.0.0-self-closing-children-20231120173528",
"type": "module",

@@ -55,3 +55,3 @@ "types": "./dist/index.d.ts",

"mocha": "^10.2.0",
"astro": "0.0.0-self-closing-children-20231120171409",
"astro": "0.0.0-self-closing-children-20231120173528",
"astro-scripts": "0.0.14"

@@ -58,0 +58,0 @@ },

@@ -11,3 +11,3 @@ import { parse, DOCUMENT_NODE, ELEMENT_NODE, TEXT_NODE } from 'ultrahtml';

function createReactElementFromNode(node) {
const childVnodes = Array.isArray(node.children)
const childVnodes = Array.isArray(node.children) && node.children.length
? node.children

@@ -21,8 +21,7 @@ .map((child) => createReactElementFromNode(child))

} else if (node.type === ELEMENT_NODE) {
const children = Array.isArray(node.children) && node.children.length === 0 ? undefined : childVnodes;
const { class: className, ...props } = node.attributes;
return createElement(node.name, { ...props, className, key: `${id}-${key++}` }, children);
return createElement(node.name, { ...props, className, key: `${id}-${key++}` }, childVnodes);
} else if (node.type === TEXT_NODE) {
// 0-length text gets omitted in JSX
return node.value.trim() ? child.value : undefined;
return node.value.trim() ? node.value : undefined;
}

@@ -29,0 +28,0 @@ }

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc