SolidJSS
SolidJS3y ago
11 replies
⛤ND⛤

passing signal to component

i try to pass a signal set function to a component but when i try to use the function inside the component i only get a props.settask is not a function error

<Todo name={cat} settodo={settasks()} list={task()}/>

the component inside the main app

export default function todo(props){

return(
 <li><button onclick={props.settasks([])}>{props.name}</button></li>
);
}

the component
Was this page helpful?