I have the following code in reactjs: How can I access any component like jquery using ID or there is some other solution?
Progressbar.jsx
class Progressbar extends Component {
constructor() {
super();
this.state = { percentage: 0 };
}
progress(percentage) {
this.setState({ percentage:percentage });
}
render() {
// using this.state.percentage for the width css property
........
........
}
};
FileUploader.jsx
class FileUploader extends Component {
onUploadProgress() {
// I want to call Progress1.progress( percentage_value )
}
render() {
........
<Progressbar id="Progress1" />
........
........
}
};