Quiero llamar a handleChange en mi componente BasicInfos desde la función Cropper. Aquí hay un código de ejemplo:
export default function Cropper() { return ( <Crop onChange={handleChange}/> // I want to call handleChange from here ); } import Cropper from "./Cropper"; @observer class BasicInfos extends React.Component { @action handleChange = (blob, url) => { tmpFile = blob; tmpFilePath = url; } render () { return ( <Cropper action={this.handleChange}/> ); } }Necesitas obtener la acción de utilería.
export default function Cropper({action}) { return ( <Crop onChange={action}/> // I want to call handleChange from here ); } import Cropper from "./Cropper"; @observer class BasicInfos extends React.Component { @action handleChange = (blob, url) => { tmpFile = blob; tmpFilePath = url; } render () { return ( <Cropper action={this.handleChange}/> ); } }