Stop deriving state from props in join component

pull/10616/head
ebb-tide 2018-05-25 17:18:32 -07:00
parent 6f02d7b90a
commit b0383bbfe1
1 changed files with 8 additions and 8 deletions

View File

@ -27,14 +27,14 @@ interface DropdownItem {
}
class Join extends PureComponent<Props, State> {
public static getDerivedStateFromProps(nextProps: Props) {
const tables = nextProps.func.args.find(a => a.key === 'tables')
if (tables) {
const keys = _.keys(tables.value)
return {table1: keys[0], table2: keys[1]}
}
return {table1: '', table2: ''}
}
// public static getDerivedStateFromProps(nextProps: Props) {
// const tables = nextProps.func.args.find(a => a.key === 'tables')
// if (tables) {
// const keys = _.keys(tables.value)
// return {table1: keys[0], table2: keys[1]}
// }
// return {table1: '', table2: ''}
// }
constructor(props) {
super(props)