I am fairly new to react and I was stuck at something trivial I feel. So what I want to do is that I want to pass data from a parent component to child. My code looks like this.
getData(key) {
let { getData } = this.props;
if (getData.code === "ON") {
Codeapi(getData._id[0])
.then(res => console.log("Result is", res)),
(error => console.log(error));
}
return (
<Dialog
key={key}
side="left"
onImageClick={this.handleClick}>
<ReactSlick />
</Dialog>
);
}
So basically I am just console logging the result out right now but I want to pass res somehow to the ReactSlick component which is wrapped inside Dialog component. How will I be able to use the res data in the ReactSlick component?