NaughtyShiba
NaughtyShiba
SSolidJS
Created by NaughtyShiba on 2/6/2025 in #support
Client-only API called on the server side.
There's this one nice library which can bundle MDX as a JSX Component. Thanks to _jsx_runtime it's easy-ish to adapt it from react-only to other JSX supporting libraries. (https://github.com/kentcdodds/mdx-bundler) I've managed to nail it down for some of the libraries, unfortunately I'm stuck with Solid's one, and I'm not that familiar with Solid (https://github.com/kentcdodds/mdx-bundler/pull/236) I've
import * as SolidH from "solid-js/h"; (_jsx_runtime is imported from there?

/** @param {JSX.HTMLAttributes<HTMLSpanElement>} props */
const SpanBold = ({children}) => {
return SolidH.default('span', { class: "strong" }, children)
}

const res = SolidH.default(SpanBold, {children: "hello"});
import * as SolidH from "solid-js/h"; (_jsx_runtime is imported from there?

/** @param {JSX.HTMLAttributes<HTMLSpanElement>} props */
const SpanBold = ({children}) => {
return SolidH.default('span', { class: "strong" }, children)
}

const res = SolidH.default(SpanBold, {children: "hello"});
And I receive
Client-only API called on the server side. Run client-only code in onMount, or conditionally run client-only component with <Show>.
Client-only API called on the server side. Run client-only code in onMount, or conditionally run client-only component with <Show>.
From what I manged to figure out about SSR (from outputs), build creates string[] which is then SSR'ed. Basically, behaves quite more different than other JSX libs (preact, react, hono, vue) especially on Server Side?
3 replies