Use createref in Editor component properly (#1227)

- Prettify editor component
This commit is contained in:
Tulsi Prasad 2021-10-24 19:46:10 +05:30 committed by GitHub
parent 1f1cd70175
commit 3c1dc290e8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -310,7 +310,6 @@ class Editor extends React.Component {
};
saveAppName = (id, name, notify = false) => {
if (!name.trim()) {
toast.warn("App name can't be empty or whitespace", {
hideProgressBar: true,
@ -319,12 +318,12 @@ class Editor extends React.Component {
this.setState({
app: { ...this.state.app, name: this.state.oldName },
})
});
return;
}
this.saveApp(id, {name}, notify);
}
this.saveApp(id, { name }, notify);
};
renderDataSource = (dataSource) => {
const sourceMeta = DataSourceTypes.find((source) => source.kind === dataSource.kind);
@ -508,8 +507,8 @@ class Editor extends React.Component {
});
};
toolTipRefHide = createRef(null);
toolTipRefShow = createRef(null);
toolTipRefHide = createRef();
toolTipRefShow = createRef();
render() {
const {