Skip to content

Commit

Permalink
Revert "chore: remove ssr check in integrations"
Browse files Browse the repository at this point in the history
This reverts commit ba27eaa.
  • Loading branch information
Nate Moore committed May 27, 2022
1 parent ba27eaa commit e833e41
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/integrations/preact/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { h, render } from 'preact';
import StaticHtml from './static-html.js';

export default (element) => (Component, props, children) => {
if (!element.hasAttribute('ssr')) return;
render(
h(Component, props, children != null ? h(StaticHtml, { value: children }) : children),
element
Expand Down
1 change: 1 addition & 0 deletions packages/integrations/react/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ function isAlreadyHydrated(element) {

export default (element) =>
(Component, props, children, { client }) => {
if (!element.hasAttribute('ssr')) return;
const componentEl = createElement(
Component,
props,
Expand Down
1 change: 1 addition & 0 deletions packages/integrations/solid/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export default (element) => (Component, props, childHTML, { client }) => {
if (!window._$HY) {
window._$HY = { events: [], completed: new WeakSet(), r: {} };
}
if (!element.hasAttribute('ssr')) return;

const fn = client === 'only' ? render : hydrate;

Expand Down
1 change: 1 addition & 0 deletions packages/integrations/svelte/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import SvelteWrapper from './Wrapper.svelte';

export default (target) => {
return (component, props, children, { client }) => {
if (!target.hasAttribute('ssr')) return;
delete props['class'];
try {
new SvelteWrapper({
Expand Down
1 change: 1 addition & 0 deletions packages/integrations/vue/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import StaticHtml from './static-html.js';

export default (element) => (Component, props, children, { client }) => {
delete props['class'];
if (!element.hasAttribute('ssr')) return;

// Expose name on host component for Vue devtools
const name = Component.name ? `${Component.name} Host` : undefined;
Expand Down

0 comments on commit e833e41

Please sign in to comment.