Nelmin
Nelmin
Explore posts from servers
SSolidJS
Created by Nelmin on 2/23/2023 in #support
Components Props and Text
Hey mates! I need to know 2 things
1. How can I add required props? 2. How can I add text to a Component like in the Example?
example:
//Component
export default function Button(props: ButtonProps) {
return (
<>
<button class={getStyle(props.type)}></button>
</>
);
}

//Site
<Button>Test</Button>
//Component
export default function Button(props: ButtonProps) {
return (
<>
<button class={getStyle(props.type)}></button>
</>
);
}

//Site
<Button>Test</Button>
9 replies