SolidJSS
SolidJS14mo ago
1 reply
yolo_ohh

<style/> inserted above the component (unwanted)solidstart SSR

use "sass":
@use "sass:math";
@use "colors";
@use "mixins";
@use "functions";

.mainContent {
    background: colors.$red;
    flex: 1;
}

use:
import { type JSXElement } from "solid-js";
import style from "./MainContent.module.scss";

interface MainContentUIProps {
    children: JSXElement;
    [key: string]: unknown;
}
const MainContentUI = ({children, ..._rest}: MainContentUIProps) => {
    return (
        <div class={style.mainContent}>
            {children}
        </div>
    );
};

export default MainContentUI;

<style/> inserted above a component when it is used in the format <Main>{children}</Main>, but not when used as <Main />
image.png
Was this page helpful?