Stop deriving state from props in join component
parent
6f02d7b90a
commit
b0383bbfe1
|
@ -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)
|
||||
|
||||
|
|
Loading…
Reference in New Issue