Hello,
Is this kind of writing function is correct in react:
onFileChangeName = event => {
this.setState({ selectedFileName: event.target.files[0].name });
};
and then use first function in another function:
onNavToEditor = async () => {
this.onFileChangeName();
this.setState({ redirect: "/ImageEditor" });
};
thanks,
Saeed