diff --git a/.changeset/empty-fans-agree.md b/.changeset/empty-fans-agree.md
new file mode 100644
index 00000000..7ed7224b
--- /dev/null
+++ b/.changeset/empty-fans-agree.md
@@ -0,0 +1,5 @@
+---
+"preact-render-to-string": patch
+---
+
+Remove text VNode casting
diff --git a/package-lock.json b/package-lock.json
index 5bb75f18..419b127a 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -26,7 +26,7 @@
"lint-staged": "^10.5.3",
"microbundle": "^0.15.1",
"mocha": "^8.2.1",
- "preact": "^10.11.1",
+ "preact": "^10.12.0",
"prettier": "^2.2.1",
"sinon": "^9.2.2",
"sinon-chai": "^3.5.0",
@@ -10791,9 +10791,9 @@
}
},
"node_modules/preact": {
- "version": "10.11.1",
- "resolved": "https://registry.npmjs.org/preact/-/preact-10.11.1.tgz",
- "integrity": "sha512-1Wz5PCRm6Fg+6BTXWJHhX4wRK9MZbZBHuwBqfZlOdVm2NqPe8/rjYpufvYCwJSGb9layyzB2jTTXfpCTynLqFQ==",
+ "version": "10.13.0",
+ "resolved": "https://registry.npmjs.org/preact/-/preact-10.13.0.tgz",
+ "integrity": "sha512-ERdIdUpR6doqdaSIh80hvzebHB7O6JxycOhyzAeLEchqOq/4yueslQbfnPwXaNhAYacFTyCclhwkEbOumT0tHw==",
"dev": true,
"funding": {
"type": "opencollective",
@@ -22502,9 +22502,9 @@
"dev": true
},
"preact": {
- "version": "10.11.1",
- "resolved": "https://registry.npmjs.org/preact/-/preact-10.11.1.tgz",
- "integrity": "sha512-1Wz5PCRm6Fg+6BTXWJHhX4wRK9MZbZBHuwBqfZlOdVm2NqPe8/rjYpufvYCwJSGb9layyzB2jTTXfpCTynLqFQ==",
+ "version": "10.13.0",
+ "resolved": "https://registry.npmjs.org/preact/-/preact-10.13.0.tgz",
+ "integrity": "sha512-ERdIdUpR6doqdaSIh80hvzebHB7O6JxycOhyzAeLEchqOq/4yueslQbfnPwXaNhAYacFTyCclhwkEbOumT0tHw==",
"dev": true
},
"preferred-pm": {
diff --git a/package.json b/package.json
index a4393301..ffdf1984 100644
--- a/package.json
+++ b/package.json
@@ -121,7 +121,7 @@
"lint-staged": "^10.5.3",
"microbundle": "^0.15.1",
"mocha": "^8.2.1",
- "preact": "^10.11.1",
+ "preact": "^10.12.0",
"prettier": "^2.2.1",
"sinon": "^9.2.2",
"sinon-chai": "^3.5.0",
diff --git a/src/index.js b/src/index.js
index 8332afaf..278d4d3e 100644
--- a/src/index.js
+++ b/src/index.js
@@ -145,15 +145,6 @@ function _renderToString(vnode, context, isSvgMode, selectValue, parent) {
rendered =
rendered +
_renderToString(child, context, isSvgMode, selectValue, parent);
-
- if (
- typeof child === 'string' ||
- typeof child === 'number' ||
- typeof child === 'bigint'
- ) {
- // @ts-ignore manually constructing a Text vnode
- vnode[i] = h(null, null, child);
- }
}
return rendered;
}
diff --git a/test/render.test.js b/test/render.test.js
index 17391c3a..7ab0bcf8 100644
--- a/test/render.test.js
+++ b/test/render.test.js
@@ -1313,7 +1313,7 @@ describe('render', () => {
);
}
- expect(render(
P481
P476951
P0-0
P0-1