I can passdown props
with spread operator. ie,
<Component x={props.x} y={props.y} />
is equal to:
<Component {...props} />
And we can use it in the component definition with the same name.
My question is how can I pass a function like this? What is the equivalent code for below?
<Component handleClick = {this.handleClick}
anotherHandleClick = {this.anotherHandleClick}/>
Edit:
Above line will pass down the function handleClick
and anotherHandleClick
to the child. Is there something like <Component {...Fns} />
so that every function will pass down as props with the same name.