SolidJSS
SolidJSโ€ข4y agoโ€ข
14 replies
CatNoir

How can I execute a function from parent?

How does ref work? I want to execute a function from parent, something like this:

// Parent
function Parent () {
  let something;

  return (
    <Child something={something}/>
  )
}

// Child
function Child(props) {
  props.something = () => console.log("hello");

  return <div>Hello</div>
}

Is something like this possible?
Was this page helpful?